赞
踩
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions;
在这个新的方法里面,有个参数launchOptions,这个参数是个NSDictionary类型的,它里面有如下key:
UIApplicationLaunchOptionsURLKey // userInfo contains NSURL with launch URL
UIApplicationLaunchOptionsSourceApplicationKey // userInfo contains NSString with launch app bundle ID
UIApplicationLaunchOptionsRemoteNotificationKey // userInfo contains NSDictionary with payload
UIApplicationLaunchOptionsLocalNotificationKey // userInfo contains a UILocalNotification
UIApplicationLaunchOptionsAnnotationKey userInfo contains object with annotation property list
UILocalNotification * notf = [launchOptionsobjectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
NSLog(@"notf:%@",notf);
if (notf != nil) {
//如果是闹钟时间到,应用程序倍启动,那么可以在这里做相关的事情。
//比如播放音乐等等。
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。