在UIViewController中创建要访问标签的属性,就像使用ColorPickerViewController中的标签一样。然后,当你推动/呈现新视图时,将其设置为自己。
ColorPickerViewController *colorPickerViewController;
@propery (nonatomic, retain) ColorPickerViewController *colorPickerViewController;
,当然还有:
@syntesize colorPickerViewController
它设置为自己的观点,提出正确的之前:
viewThatYouArePresenting.colorPickerViewController = self.
[self.navigationController pushViewController:youViewController animated:YES]//Or whichever your using, this is just an example
,那么你可以从视图设置它就像你正在做的:
colorPickerViewController.Labelniz = @"xxxxx";
这样做:
ColorPickerViewController *controller = [[ColorPickerViewController alloc] init];
实例化控制器的另一个实例,因此基本上变化的新instatiated标签ColorPickerViewController.What你想要的是改变标签在已经实例化的ColorPickerViewController。
谢谢,很好的回答! – 2012-01-13 19:42:18