关于手机自带照相机内存泄露的问题
我在调用手机自带相机的时候出现了内存泄露,代码如下
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.allowsEditing = NO;
if (sender.tag == 1)
{
[imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
}
else
{
[imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
}
[imagePicker setDelegate:self];
NSLog(@"picker retaincount1 %i",[imagePicker retainCount]);
[self presentModalViewController:imagePicker animated:YES];
NSLog(@"picker retaincount2 %i",[imagePicker retainCount]);
控制台输出的是
picker retaincount1 1
picker retaincount2 4
怎么变成4了呢?求大神解决
uiimagepickercontroller imagepicker ios iphone
苦逼磨拉大
10 years, 6 months ago