Loading

Wednesday, December 29, 2010

Store imge from URL to app bundle

NSString *StrUrl=[[NSString alloc] initWithFormat:@"%@",yourURLstring];
NSData *_PicData=[[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:StrUrl] ];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsPath =[NSString stringWithFormat:@"%@/%@",[paths objectAtIndex:0],YourPhotoName.Ext];
[_PicData writeToFile:documentsPath atomically:YES];