XCode is driving me nuts, when I register for multiple notification types:
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge];
or
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound|UIRemoteNotificationTypeBadge)];
It throws and error not a warning:
error: Semantic Issue: Cannot initialize a parameter of type ‘UIRemoteNotificationType’ with an rvalue of type ‘int’
Even though this is the same line that everyone uses (even Apple in their demos). I’m using the iOS 5 SDK (first one that came out after release of iOS 5) & XCode 4.2. The project is a older project (XCode 3 & iOS 4) that is being upgraded and targeted for iOS 5.
I had this problem too. The trick is if this code is in a .mm file (Objective C++), this error occurs. If you aren’t using any C++ features, change the filename extension from .mm to .m and it will compile OK.