【发布时间】:2013-10-27 00:58:45
【问题描述】:
我正在尝试将数据从一个 UITableViewController 传递到另一个。这是我在初始视图控制器中的代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
Subject *subject = (Subject *)[self.fetchedResultsController objectAtIndexPath:indexPath];
[self showList:subject animated:YES];
[self.tableView deselectRowAtIndexPath:indexPath animated:YES];
}
- (void)showList:(Subject *)subject animated:(BOOL)animated {
ListsViewController *lists = [[ListsViewController alloc] initWithStyle:UITableViewStyleGrouped];
lists.subject = subject;
NSLog(@"%@", lists.subject);
[self performSegueWithIdentifier:@"showDetail" sender:self];
}
日志输出显示它有我想要的数据已被传递。但是,当我执行 segue 并在ListsViewController 中记录subject 时显示为空。
有什么想法吗?
【问题讨论】:
标签: iphone ios objective-c storyboard segue