我的父 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