我正在使用 UIImagePickerController 从相机获取图像。就在我捕获图像并使用 UIImagePickerControllerOriginalImage 获取内存警告之后。我正在使用带有 iOS 的 iphone 4s。
代码在这里
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[self dismissViewControllerAnimated:YES completion:nil];
UIImage* originalImage = [info objectForKey:UIImagePickerControllerOriginalImage];
//Getting memory warning after this line
NSData *data =UIImageJPEGRepresentation(originalImage, 0.1);
}