我打开摄像头,为用户拍摄照片。 我不断收到内存泄漏,当我拍了照片并挤压的“使用”:自我presentModalViewController:imagePicker动画:是]
全码:
imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.mediaTypes = [NSArray arrayWithObjects:
(NSString *) kUTTypeImage,
(NSString *) kUTTypeMovie, nil];
imagePicker.allowsEditing = NO;
[self presentModalViewController:imagePicker animated:YES]; //This leaks
在这两个didFinishPickingMediaWithInfo
和imagePickerControllerDidCancel
我把这个行:
[imagePicker dismissModalViewControllerAnimated:YES];
我不知道这个问题以前有人问,但他们没有看到帮我任何进一步与我有泄漏。