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.
You should cast it explicitly to UIRemoteNotificationType
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationType)(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With