在我的应用程序委托中,如果保存了用户详细信息,我会将用户推送到视图控制器
AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
// cached user
PFUser *currentUser = [PFUser currentUser];
if (currentUser)
{
NSLog(@"current user signing and looking for VC %@", currentUser);
// A user was cached, so skip straight to the main view
UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
TaskSelectionViewController*viewController = [[TaskSelectionViewController alloc] initWithUser:currentUser];
[navigationController pushViewController:viewController animated:YES];
NSLog(@"VC found");
} else {
NSLog(@"VC not found");
}
任务选择视图控制器.m
-(id)initWithUser:(PFUser *)currentUser
{
NSLog(@"current user %@", currentUser);
NSLog(@"task Selection initwithuser");
return self;
}
推送正在工作,但我得到的只是顶部的 NavigationController 栏和黑屏。
缺什么 ??
谢谢你的帮助。