2015年6月2日星期二

获取绑定的页面类(instantiateViewControllerWithIdentifier)


setupViewControll=[self.storyboard instantiateViewControllerWithIdentifier:@"SetupViewControllView"];

这个是绑定页面的. 当对应页面绑定对应类时 使用这个就可以直接拿过来 页面的绑定类了

之后可以直接用该页面的控件

比如
UIViewController A

UIViewController B{
  @property(weak,nonatomic)IBOutlet UISwitch *swichControl;
}

在A页面里 
有 B b=[self.storyboard instantiateViewControllerWithIdentifier:@"B"];
那么 b.swichControll就是页面B的 UISwitch控件了

没有评论:

发表评论