該類是UITabBarViewController的子類。 在我的init父視圖控制器文件,我有這樣的:parentViewController的值
UIBarButtonItem *button1 = [[UIBarButtonItem alloc]
initWithTitle:@"Button1"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(button1:)];
self.navigationItem.rightBarButtonItem = button1;
[button1 release];
而且方法:
-(IBAction)button1:(id)sender {
if (self.nvc == nil) {
ChildViewController *vc = [[ChildViewController alloc] init];
self.nvc = vc;
[vc release];
}
[self presentModalViewController:self.nvc animated:YES];
我想在我的childviewcontroller類,這也是一個UITabBarViewController子類來從parentviewcontroller的價值。
我該如何做到這一點,我嘗試了幾個小時,而且我只得到一個無參考。
我想要得到的對象(這是父級中的屬性)是一個NSString。
預先感謝