0
我正在初始化導航控制器並設置根視圖控制器。在呈現控制器之前,我設置了一個變量。但是,當新視圖加載時,該變量爲空。我究竟做錯了什麼?將參數傳遞給導航控制器的根
NSString *email = jsonDict[@"email"];
EmailPopUpViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"EmailPopUp"];
CGRect screenBound = [[UIScreen mainScreen] bounds];
CGSize screenSize = screenBound.size;
CGFloat screenWidth = screenSize.width;
CGFloat screenHeight = screenSize.height;
CGFloat xcoord = (screenHeight - 900)/2;
CGFloat ycoord = (screenWidth - 640)/2;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
controller.emailURL = email;
NSLog(@"email: %@", email);
navController.modalPresentationStyle = UIModalPresentationFormSheet;
navController.view.superview.frame = CGRectMake(xcoord, ycoord, 640, 900);
[self presentViewController:navController animated:NO completion:nil];
你設置屬性爲**非原子**和** **強的'emailURL'? –