我正在使用 Facebook API,当用户选择一个地方(CheckIn)时,我想打开另一个视图并传递这个地方(FBGraphPlace),但是在“SecondViewController”中,当方法“viewDidLoad”被执行时,变量为空. 当用户选择地点时:
if (secondViewController == nil)
{
SecondViewcontroller *secondViewcontroller =
[[SecondViewcontroller alloc]
initWithNibName:NSStringFromClass([SecondViewcontroller class])
bundle:[NSBundle mainBundle]];
self.secondViewcontroller = secondViewcontroller;
}
// How you reference your navigation controller will
// probably be a little different
UIBarButtonItem *newBackButton = [[UIBarButtonItem alloc] initWithTitle: @"Back" style: UIBarButtonItemStyleBordered target: nil action: nil];
[[self navigationItem] setBackBarButtonItem: newBackButton];
secondViewController.place = self.selectedPlace;
[self.navigationController
pushViewController:self.secondViewcontroller
animated:YES];