【发布时间】:2011-05-06 17:31:00
【问题描述】:
我的父 ViewController 类包含一个 UISearchBar。我有一个 UIButton,它将通过下面的代码推送一个新的 ViewController
AddViewController *addViewController = [[AddViewController alloc] initWithNibName:@"AddView" bundle:nil];
[self presentModalViewController:addViewController animated:YES];
[addViewController release];
在 AddViewController 中,用户会看到动物名称的 TableView。在
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
我提取动物名称并将其存储在 NSString 中。然后我通过
关闭 AddViewController[self dismissModalViewControllerAnimated:YES];
我的问题是如何将 NSString 动物名称传递给 AddViewController 的父 ViewController?我正在尝试将动物名称放在 UISearchBar
【问题讨论】:
标签: iphone objective-c uiviewcontroller modalviewcontroller