Quick question, Instruments is reporting a leak here...
MyViewController *myVC = [[MyViewController alloc] initWithNibName:@"myView" bundle:nil];
[self.navigationController pushViewController:myVC animated:YES]; //<<<<---- !00% leak according to Instruments
[myVC release];
I understand the myVC is retained by the nav controller, so I assume the nav controller releases them when the view is popped off the nav stack?
Also, there's another tricky one in one of my loops, the static analyzer is reporting a potential leak here...
//Walk through the scheduled alarms and create notifications
NSMutableArray *fireDates = [[NSMutableArray alloc] init];
for(NSDate *fireDate in fireDates) //<<<<---- Static analyzer is reporting potential leak here
{
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
{
[fireDates release];
return;
}
localNotif.fireDate = fireDate;
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.alertBody = [NSString stringWithFormat:@"%@", alarm.Label];
localNotif.alertAction = NSLocalizedString(@"Launch", nil);
localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.userInfo = infoDict;
localNotif.repeatInterval = NSWeekCalendarUnit;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
[localNotif release];
}
[fireDates release];
Do I need to somehow release fireDate?
Thanks in advance for your help!