iOS の「didSelectRowAtIndexPath」を使用して、アイテムの行 ID を取得しようとしました。コード:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
indexPathRow=indexPath.row;
self.recordIdToEdit = [[[deviceNameArray objectAtIndex:indexPath.row] objectAtIndex:0] intValue];
NSLog(@"Item selected..%d", self.recordIdToEdit);
[self performSegueWithIdentifier:@"DetailsViewController" sender:nil];
}
デバッグ中に po の次のエラーが発生します。
(lldb) po [deviceNameArray objectAtIndex:indexPath.row]
error: property 'row' not found on object of type 'NSIndexPath *'
error: 1 errors parsing expression
(lldb) po indexPathRow
<nil>
ここで何がうまくいかないのですか?deviceNameArray は、sqlite db から取得した結果を含む文字列の配列です。