I am relatively new to iPhone Development, so this may be my mistake, but this is contrary to what I saw. :)
I think I'm creating a UIAlertView that lives in this very vacuum of the if statement.
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
if(!data)
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Unable to contact server"
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
NSLog(@"retain count before show: %i", alert.retainCount);
[alert show];
NSLog(@"retain count before release: %i", alert.retainCount);
[alert release];
NSLog(@"retain count after release: %i", alert.retainCount);
return nil;
}
However, console magazines disorient me.
retain count before show: 1
retain count before release: 6
retain count after release: 5
I also tried adding:
alert = nil;
after graduation. This makes the hold counter 0, but I still see the leak. And if that helps, the leak The responsible frame is UIKeyboardInputManagerClassForInputMode. I also use OS 4 Beta 3.
So, does anyone have any idea how the local UIAlertView counter will increment itself by 5 when -show is called?
Thank you for your help!
source
share