iOS实现图片存在本地、再从本地获取图片的功能,代码如下: //将图片保存到本地 + (void)SaveImageToLocal:(UIImage*)image Keys:(NSString*)key { NSUserDefaults* preferences = [NSUserDefaults standardUserDefaults]; //[preferences persistentDomainForName:LocalPath]; [preferences setObject:UIImagePNGRepresentation(image) forKey:key]; } //