我已按照教程Passing Data between View Controllers部分传递数据转发。我的代码是:将整数传递给DetailViewController
MasterViewController.h:
-(void)pushViewController: (UIViewController *)detailVC animated:(BOOL)animated;
MasterViewController.m:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell=[tableView cellForRowAtIndexPath:indexPath];
NSInteger num = indexPath.row;
DetailViewController *detailVC = [[DetailViewController alloc] initWithNumber:indexPath.row];
detailVC.number = num;
[self pushViewController:detailVC animated:YES];
}
我想整数NUM传递给我的DetailViewController。但是我得到了线程1:SIGABRT。发生什么事?
见http://raywenderlich.com/ 10209/my-app-crashed-now-what-part-1 – rmaddy
添加断点并检查... –
向您的帖子中添加'pushViewController:animated:'方法代码。 –