I'd like to have a TTLauncherItem with image from documents folder?
How do I go about this?
Thanks!
My solution is fairly simple. I use TTURLCache class to store the
image for particular URL and later pass that URL to TTLauncherItem
image property:
//get the image
NSString *fileName = @"MyThumbnail.png";
NSArray *paths = NSSearchPathForDirectoriesInDomains
(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *imageFilePath = [documentsDirectory
stringByAppendingPathComponent:fileName];
UIImage *thumbnail = [UIImage imageWithContentsOfFile:imageFilePath];
//store the image
[[TTURLCache sharedCache] storeImage:thumbnail forURL:fileName];
//create TTLauncherItem with that image
TTLauncherItem *item = [[[TTLauncherItem alloc] initWithTitle:@"Some
Title" image:fileName URL:@"itemURL" canDelete:NO] autorelease];
Voila! ;]
Hope that helps someone, cheers ;]