无法使用 int 类型的右值初始化 UIRemote NotificationType 类型的参数
当我使用 [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
注册远程推送通知时,会出现错误,提示 cannotinitialize a parameter of type 'UIRemoteNotificationType' with an 'int' 类型的右值
,有人知道为什么吗?谢谢。
我的项目环境:Xcode 4.2 + iOS 5。
When I use [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
to register remote push notificatioin, an error occurs saying cannot initialize a parameter of type 'UIRemoteNotificationType' with an rvalue of type 'int'
, does anybody know why? thank you.
My project's environment: Xcode 4.2 + iOS 5.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该将其显式转换为
UIRemoteNotificationType
You should cast it explicitly to
UIRemoteNotificationType