iOS 8 Only Memory Leak with UIAlertController or UIActionSheet

I’m seeing a memory leak in iOS 8 in simulator when I do the following with UIActionSheet or UIAlertController. UIActionSheet uses UIAlertController in IOS 8 so the issues are related.

showCameraAction gets called when a button is pressed. I’ve removed all of the content from the delegate method and still get the leak in the case shown below. Am I using UIActionSheet in some way that I shouldn’t? I would appreciate any help in resolving this issue. The same code has no leaks with IOS 7 (in the simulator).

-(IBAction)showCameraAction:(id)sender
{

UIActionSheet* actionSheet = [[UIActionSheet alloc] initWithTitle:@"Photo From:"
                                                         delegate:self
                                                cancelButtonTitle:@"Cancel"
                                           destructiveButtonTitle:nil
                                                otherButtonTitles:@"Phone", @"Flickr", nil];

[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
//also tried  just showInView: self.view
}

//empty

 - (void)actionSheet:(UIActionSheet *)actionSheet
 clickedButtonAtIndex:(NSInteger)buttonIndex {
 }

Also tried with UIAlertController, with the same result:

UIAlertController *alertController = [UIAlertController
                                      alertControllerWithTitle:@"Photo From:"
                                      message:@""
                                      preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *phoneAction = [UIAlertAction
                               actionWithTitle:NSLocalizedString(@"Phone", @"Phone action")
                               style:UIAlertActionStyleCancel
                               handler:^(UIAlertAction *action)
                               {
                                   NSLog(@"Phone action");
                               }];

UIAlertAction *flickrAction = [UIAlertAction
                           actionWithTitle:NSLocalizedString(@"Flickr", @"Flickr action")
                           style:UIAlertActionStyleDefault
                           handler:^(UIAlertAction *action)
                           {
                               NSLog(@"Flickr action");
                           }];

[alertController addAction:phoneAction];
[alertController addAction:flickrAction];

[self presentViewController:alertController animated:YES completion:nil];

Leaks tool screenshot

Screenshot with trace:


Download ios.8.only.memory.leak.with.uialertcontroller.or.uiactionsheet.zip
Direct Link


Download


Download ios.8.only.memory.leak.with.uialertcontroller.or.uiactionsheet.zip
Mediafire


Download


Download ios.8.only.memory.leak.with.uialertcontroller.or.uiactionsheet.zip
Unlimitzone


Download


Download ios.8.only.memory.leak.with.uialertcontroller.or.uiactionsheet.zip
.torrent


Download


Download ios.8.only.memory.leak.with.uialertcontroller.or.uiactionsheet.zip
Filedwon


Download

Both comments and pings are currently closed.

Comments are closed.