简单的通过NSFileManager 存储图片

UIImage *image = [UIImage imageNamed:@"Default.png"];

    NSData *data = UIImageJPEGRepresentation(image,0.7);

    NSArray  *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

    NSString *documentDirectory = [paths objectAtIndex:0];

    NSFileManager *fileManager = [NSFileManager defaultManager];

    NSString *fullPath = [documentDirectory stringByAppendingFormat:@"/de.png"];

    [fileManager createFileAtPath:fullPath contents:data attributes:nil];

 

你可能感兴趣的:(manager)