安排多个本地通知冻结了我的应用程序

时间:2012-01-27 12:48:08

标签: iphone objective-c ios ios4 ios5

当我安排多个UILocalNotification(60)时,我的应用程序会在一段时间内无响应。此外,整个iPhone系统都被冻结了。

这是我的代码:

 // Configure the notification properties
    UILocalNotification *localNotif = [[UILocalNotification alloc] init];
    localNotif.timeZone = tempTimeZone;
    localNotif.fireDate = [dict objectForKey:@"fireDateKey"];
    localNotif.alertBody = [dict objectForKey:@"alertBodyKey"];
    localNotif.alertAction = @"View";
    localNotif.soundName = UILocalNotificationDefaultSoundName; // Set the sound for notification
    localNotif.applicationIconBadgeNumber += 1; // Increase the aplication badge number with 1
    localNotif.userInfo = [NSDictionary dictionaryWithObjectsAndKeys:[dict objectForKey:@"ID"], ojectIDKey, nil];

    // Schedule the notification
    [application scheduleLocalNotification:localNotif];
    [localNotif release];

有什么建议吗?

0 个答案:

没有答案