Here is the code I use for presentation UIImagePickerController:
- (IBAction)takePhoto:(UIButton *)sender {
if (![UIImagePickerController
isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIAlertController *alert = [UIAlertController
alertControllerWithTitle:NSLocalizedString(@"Error", nil)
message:NSLocalizedString(@"Device has no camera", nil)
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *ok =
[UIAlertAction actionWithTitle:NSLocalizedString(@"OK", nil)
style:UIAlertActionStyleDefault
handler:nil];
[alert addAction:ok];
[self presentViewController:alert animated:YES completion:nil];
} else {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.videoQuality = UIImagePickerControllerQualityTypeMedium;
[self presentViewController:picker animated:YES completion:NULL];
}
}
I am currently running this method (e.g. click on UIButton). I see this in Tools:

And this is what I see if I switch to Cycles and Roots:

So, if I move on to the first leak and click on the arrow that appears, I get the following:

and if I open the stack trace for this method, I see:

So these are basically system calls. The same goes for other leaks, just system calls ... So is this a mistake or ?? If I open and remove the image picker several times, I get even more leaks, much more ...
Has anyone noticed this?