I am unable to save and retrieve image in iOS
问题 I am unable to save and retrieve image in iOS. I am getting nil image trough this code: -(NSString *)saveImageDataWithImage:(UIImage *)image { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory,NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *photoName = [NSString stringWithFormat:@"%ld.png", (long)[[NSDate date] timeIntervalSince1970]]; NSString *getImagePath = [documentsDirectory stringByAppendingPathComponent:photoName];