我是ios和Objective-c的新手,我从xcode得到了这个警告,并且不知道该怎么做。
willRotateToInterface也没有工作,我也检查了其他问题,但它只有相同的方式来应用它。
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
UIUserNotificationSettings *settings =
[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert |
UIUserNotificationTypeBadge |
UIUserNotificationTypeSound
categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
UIRemoteNotificationTypeAlert |
UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeSound];
}
我收到警告registerForRemoteNotificationTypes:'不推荐使用:首先在iOS 8.0中弃用 - 使用 - [UIApplication registerForRemoteNotifications]和UserNotifications Framework's - [UNUserNotificationCenter requestAuthorizationWithOptions:completionHandler:]
请实施以下方法
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context)
{
//..... Your code here
} completion:^(id<UIViewControllerTransitionCoordinatorContext> context)
{
}];
[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
}