Мне нужно отменить UILocalNotification по функции, но если я использую
[[UIApplication sharedApplication] cancelAllLocalNotifications];
, я снова попадаю в приложение, но приложение зависло, таймер
UILocalNotification *local = [[UILocalNotification alloc] init];
local.fireDate = [NSDate dateWithTimeIntervalSinceNow:10];
local.timeZone = [NSTimeZone defaultTimeZone];
local.alertBody = @"";
local.alertAction = @"";
NSDictionary *customInfo =
[NSDictionary dictionaryWithObject:@"ABCD1234" forKey:@"yourKey"];
local.userInfo = customInfo;
[[UIApplication sharedApplication] scheduleLocalNotification:local];
[local release];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@""message:@""delegate: self cancelButtonTitle:@"Close"otherButtonTitles: nil];
[alert show];
[alert release];
[self performSelector:@selector(myFunc) withObject:nil afterDelay:10.0];
startDate = [[NSDate date]retain];
// Create the stop watch timer that fires every 10 ms
myTime = [NSTimer scheduledTimerWithTimeInterval:1.0/10.0
target:self
selector:@selector(updateTimer)
userInfo:nil
repeats:YES];