我的AppDelegate.m
. 我想要我的deviceToken
价值UIViewController
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
NSLog(@"My token is: %@", deviceToken);
ViewController *viewController = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
viewController.tokenStr = [NSString stringWithFormat:@"%@",deviceToken];
}
但是当我显示时NSLog(@"%@",tokenStr);
,UIViewController
我得到了(NULL)
. 我怎样才能得到我的价值UIViewController
?