NSMutableArrayを使用してForSegueを準備する方法は?
NSMutableArray *theNews;
これはprepareForSegueコードです
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"showDetail"]) {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
NSManagedObject *object = [[theNews objectAtIndex:indexPath.row] objectAtIndexPath:indexPath];
[[segue destinationViewController] setDetailItem:object];
}
}
コードを実行すると、次のエラーが発生します。
キャッチされなかった例外'NSInvalidArgumentException'が原因でアプリを終了しています、理由:'-[__ NSDictionaryM objectAtIndexPath:]:認識されないセレクターがインスタンス0x81c0f40に送信されました