【发布时间】:2011-09-08 00:33:03
【问题描述】:
我需要按功能取消 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];
【问题讨论】:
标签: iphone objective-c push-notification xcode3.2