谢小进*_*谢小进 5 push-notification apple-push-notifications ios ios5
当我[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];用来注册远程推送通知时,发生错误说cannot initialize a parameter of type 'UIRemoteNotificationType' with an rvalue of type 'int',有人知道为什么吗?谢谢.
我的项目环境:Xcode 4.2 + iOS 5.
jba*_*100 14
你应该明确地把它强制转换为 UIRemoteNotificationType
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationType)(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
Run Code Online (Sandbox Code Playgroud)