Cannot initialize parameter of type UIRemote NotificationType with rvalue of type int

When I use [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];remote push notificatioin for registration, an error occurs saying cannot initialize a parameter of type 'UIRemoteNotificationType' with an rvalue of type 'int'if anyone knows why? thank.

My project environment: Xcode 4.2 + iOS 5.

+5
source share
1 answer

You must explicitly point it to UIRemoteNotificationType

[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationType)(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
+14
source

All Articles