I have one picker view on screen 1 once i select component from picker view. selected item display on screen 2 navigation bar title. How can we achieve pleas help me.
Array[abc,xyz,cde,ope];
Thanks
您需要将选定的值传递给下一个视图控制器,并将选定的值设置为导航栏标题。
在视图控制器 2 viewcontroller2.h中创建一个 NSString 实例
@property(nonatomic,retain)NSString *title;
在视图控制器 1 中导航到 viewcontroller2 之前,您需要将所选视图设置为 viewcontroller 2 标题实例(一种将值发送到下一个视图)
视图控制器 1:
ViewController1 *view1 = [[ViewController1 alloc] init];
view1.title = pickerSelectedString;
[self.navigationController pushViewController:view1];