私は、prepareForSegue関数の下でsegueを通してデータを渡そうとしていますが、私はexc_bad_accessを得続けます。prepareForSegue EXC_BAD_ACCESS at indexPath.row
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
//NSIndexPath *indexPath = [NSIndexPath indexPathForRow:rowIndex inSection:0];
// Make sure your segue name in storyboard is the same as this line
if ([[segue identifier] isEqualToString:@"itemListSegue"])
{
itemList *vc = [segue destinationViewController];
vc.inv = [inv_list objectAtIndex:indexPath.row];
vc.title = vc.inv;
}
}
怒鳴るは、私が得たエラーです
EDIT:
@interface downloadInv(){
NSMutableArray *inv_list;
}
をとのviewDidLoadで: inv_listのように宣言され、その後
inv_list = [[NSMutableArray alloc] init];
コンテンツ:
vc.invは、私は、テーブルが選択された場合、宛先ビューコントローラに渡すinv_listにおける特定の要素です。
以下のようにそれが宣言されました:
@interface itemList : UITableViewController
@property(nonatomic, strong) NSString *inv;
@end
この問題を解決する方法を誰もが知っていますか?
ありがとうございます。
'inv_list'とは何ですか?それは配列ですか?あなたが 'prepareforsegue'で正しいindexpatを得ていることを確認してください。 – Lion
'inv_list'の定義方法を教えてください。 –
リストの内容と、あなたが入力しようとしているvcのプロパティを教えてください。 –