仅当使用故事板和segue时,iOS6中的EXC_BAD_访问错误
我正在我的应用程序中使用故事板。我正在使用下面的代码从UITableView导航到另一个UIView仅当使用故事板和segue时,iOS6中的EXC_BAD_访问错误,ios6,uistoryboardsegue,xcode-storyboard,Ios6,Uistoryboardsegue,Xcode Storyboard,我正在我的应用程序中使用故事板。我正在使用下面的代码从UITableView导航到另一个UIView -(void)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self performSegueWithIdentifier:@"showNextView" sender:self]; } -(void)prepareForSegue:(UIStoryboar
-(void)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"showNextView" sender:self];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"showNextView"])
{
AnotherViewController *destination = [segue destinationViewController];
// do something with the destination.
}
}
当我使用iOS5和iOS5.1模拟器时,根本没有问题。但当我使用iOS6模拟器时,我得到了如下错误
线程1:EXC\u错误访问(代码=2,地址=0x10)
一致
0x1588098: movl (%eax), %edx
归档
libobjc.A.dylib`objc_msgSend:
甚至我也将另一个ViewController设置为纯空白视图。我仍然得到同样的错误
谢谢我解决了我的问题。由于某些原因,我们无法在iOS 6中使用-(void)tableView:(UITableView*)tableView将选择RowatineXpath:(NSIndexPath*)indexPath。好了,我用错方法了。应使用-(NSIndexPath*)tableView:WillSelectRowatineXpath: