Thursday, 15 September 2011

iOS 8 Only Memory Leak with UIAlertController or UIActionSheet -



iOS 8 Only Memory Leak with UIAlertController or UIActionSheet -

i'm seeing memory leak in ios 8 in simulator when next uiactionsheet or uialertcontroller. uiactionsheet uses uialertcontroller in ios 8 issues related.

showcameraaction gets called when button pressed. i've removed of content delegate method , still leak in case shown below. using uiactionsheet in way shouldn't? appreciate help in resolving issue. same code has no leaks ios 7 (in 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 showinview: self.view }

//empty

- (void)actionsheet:(uiactionsheet *)actionsheet clickedbuttonatindex:(nsinteger)buttonindex { }

also tried uialertcontroller, 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];

screenshot trace: https://www.dropbox.com/l/fmntcd0pvvhuu16bvhzo7p

this ios bug.

see apple bug reporter issue 21005708, memory leak in uialertcontroller under arc.

ios memory-leaks ios8 uiactionsheet uialertcontroller

No comments:

Post a Comment