2011-08-22 87 views
0

我有一个iPhone应用程序中,我使用的日常防火UILocalnotification,每周和每年有没有什么好的教程是我使用此代码来设置通知如何设置UILocalNotifications每天每周和每年

- (void)alertSelector:(NSString *)AlertTitle WithFiringTime:(NSDate *)date{ 
    UILocalNotification *localNotification = [[[UILocalNotification alloc] init] autorelease]; 

    if (!localNotification) 
     return; 
    // Set the fire date/time 
    [localNotification setFireDate:date]; 
    [localNotification setTimeZone:[NSTimeZone defaultTimeZone]]; 

    // Create a payload to go along with the notification 
    NSDictionary *data = [NSDictionary dictionaryWithObject:date forKey:@"payload"]; 
    [localNotification setUserInfo:data]; 

    // Setup alert notification 
    [localNotification setAlertBody:AlertTitle]; 
    [localNotification setAlertAction:@"View"]; 
    [localNotification setHasAction:YES];  

    [UILocalNotification setBadge]; 

// localNotification.soundName = UILocalNotificationDefaultSoundName; 
// [email protected]"voice.aif"; 

    // Schedule the notification   
    [[UIApplication sharedApplication] scheduleLocalNotification:localNotification]; 
} 

thankx

回答

1

也许this tutorial帮助...

+0

谢谢切尔本教程中,你只是解决我的问题。 :) –

相关问题