i use a UIPickerView in my root view of UINavigationController . And i used one button, when i pressed it, pass the data(shows in picker) to the next level view of navigation controller. How should i do this? Thank you!
And can you tell me the right way 开发者_如何学编程to manage data or share data among multi-viewControllers. Thanks.
Make the UINavigationController is the delegate of the UIPickerView. And save the data when scroll the picker in this method:
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component;{ ...NSString * passedString = [myArray objectAtIndex:row];...}
After that when the button was pressed, pass the "passedString" into next viewController.
精彩评论