I have an issue that makes my application crash, and I have tried everything to change it, but with no luck. So I hope that a new set of eyes could help me out a little bit.
Here is a view of my code:
.h
@property (nonatomic, retain) UILocalNotification *notification;
.m
- (void)applicationDidEnterBackground:(UIApplication *)application
{
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.fireDate = [[NSDate date] dateByAddingTimeInterval:60*60*24];
notification.alertBody = @"Skal du ikke træne i dag? Det tager kun 7 minutter!";
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
}
It gives me the following error when analyzing it:
- Potential leak of an object stored into 'notification'
I really hope that one of you could help me out. Thanks!