Reputation: 1721
I want to save an image with ".wai" extension, for send it trough whatsapp.h ow can I save the image with this format? The whatsapp site don't have a sample code, for more information this is the link (propbably visiting this link you understand my problem)
http://www.whatsapp.com/faq/en/iphone/23559013
Upvotes: 0
Views: 144
Reputation: 271
NSData *pngData = UIImagePNGRepresentation(drawimg.image);
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsPath = [paths objectAtIndex:0]; //Get the docs directory
filePath = [documentsPath stringByAppendingPathComponent:@"edited.wai"]; //Add the file name
[pngData writeToFile:filePath atomically:YES];
Upvotes: 1