我在NSInteger中有一个变量,我想从FirstViewController传递给SecondViewController。在ViewDidload的FirstViewController我有这个
SecondViewController*detail = [self.storyboard instantiateViewControllerWithIdentifier:@"Second"];
detail.integer2= self.integer1;
NSLog(@"VARIABLE PASSED----%d",detail.integer2 );
NSLog正好显示了我想传递的内容。我的问题是如何在SecondViewController中检索传递的值。
答案 0 :(得分:3)
在SecondViewController中,您只需拨打self.integer2
答案 1 :(得分:2)
在integer2
中设置SecondViewController
的属性,并在self.integer2
中使用SecondViewController