博文转载至  http://blog.csdn.net/cerastes/article/details/39546625
 
ios8推送问题
registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later.
 
- if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)  
 
- {  
 
-     [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings   
 
-      settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)        
 
- categories:nil]];  
 
-   
 
-   
 
-     [[UIApplication sharedApplication] registerForRemoteNotifications];  
 
- }  
 
- else  
 
- {  
 
-     [[UIApplication sharedApplication] registerForRemoteNotificationTypes:  
 
-      (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];  
 
- }  
 
 
 
判断PUSH是否打开
 
- {  
 
- UIRemoteNotificationType types;  
 
- if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)  
 
-    {  
 
-  types = [[UIApplication sharedApplication] currentUserNotificationSettings].types;  
 
-     }  
 
- else  
 
-    {  
 
-  types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];  
 
-     }  
 
-   
 
-   
 
- return (types & UIRemoteNotificationTypeAlert);  
 
- }