2011-12-14 27 views
5

türünde bir parametre ile başlatılamıyor. Uzaktan itme notificatioin kaydetmek için [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; kullandığımda, cannot initialize a parameter of type 'UIRemoteNotificationType' with an rvalue of type 'int' diyen bir hata oluştu, kimse nedenini biliyor mu? teşekkür ederim., UIRemote NotificationType türünde bir parametre intr:

Benim projenin çevre: Xcode 4.2 + iOS 5.

+0

Olası yinelenen açık şekilde kullanması gereklidir http://stackoverflow.com/questions/2584453/uiremotenotificationtype-invalid-conversion – jbat100

+0

Çok mutluyum ve ayrıca teşekkür ederim. –

cevap

14

Sen UIRemoteNotificationType

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

İşte bu! Çok teşekkür ederim. –

+0

@ jbat100 Teşekkürler! Benim için çalıştı ama neden burada döküm ihtiyacımız olduğunu açıklayabilir misiniz? – Developer

+0

@Harsh Enum üzerinde bitly işlemi gerçekleştirdiğinizde, örneğin, (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound), işlemin sonucu, derleyicinin enum'u temsil ettiği türdür. onun değerleri), genellikle bir tamsayı tipi. Yine de bu durumda neden dolaylı olarak UIRemoteNotificationType'a geri göndermediğinden emin değilim. – jbat100

İlgili konular