Friday, April 5, 2013

Save Image to document directory IOS:-


Save Image to document directory:-

- (void)saveImage {

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"savedImage.png"];
    NSLog(@"savedImagePath..%@",savedImagePath);
    NSData *imageData = UIImagePNGRepresentation(Image);
    [imageData writeToFile:savedImagePath atomically:YES];  
    
  
}

No comments:

Post a Comment