Hello Brad,
I have an application which sets an web image to the background of the homepage.From next time it loads the homepage background from web as my application stores just the name with the address.This is my code:
Sqlite *sqlite = [[Sqlite alloc] init];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, SUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:@"Database.db"];
if (![sqlite open:writableDBPath])
return;
NSURL *url = [NSURL URLWithString:@"http://mmabigshow.com/app/admin/ring_girl_demo.php"];
NSString *greeting = [[NSString alloc] initWithContentsOfURL:url];
NSString *string1 = @"";
string1 = [NSString stringWithFormat:@"UPDATE mma_bg_image SET image='%@' where id='1';", greeting];
What I want to do is, that when I set some image as background it should be stored as UIImage object in the local database of the phone so that it will load faster from next time onwards. Should I use Sqlite? Please paste me the total source code of the process.
Thanks in advance
Rohit Y