我将以下代码用于图像选择器。但是,当我在模拟器中运行它时,内存泄漏,并且收到有关presentModalViewcontroller:animated
在iOS6中弃用的警告。我也被dismissModalViewController:animated
弃用了。我正在使用SDK 6.1。
ImagePicker的代码:
- (void)showAlbum:(id)sender {
imagePicker=[[UIImagePickerController alloc]init];
imagePicker.delegate = self;
imagePicker.allowsEditing =NO;
imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:imagePicker animated:YES];
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{
//release picker
[picker dismissModalViewControllerAnimated:YES];
}