1
在commitEditingStyle tableView方法中,「.row」屬性在NSIndexPath上不起作用。有任何想法嗎?commitEditingStyle中的NSIndexPath
這裏是呼叫
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete)
{
NSLog(@" Delete button pushed. IndexPath:%@",indexPath);
}}
當刪除按鈕在表中的日誌信息是第三排推:
「刪除按鈕按下。 IndexPath:2索引[0,2]」
如果我更改日誌消息:
NSLog(@" Delete button pushed. IndexPath.row:%@",indexPath.row);
我得到一個編譯錯誤。是什麼賦予了?我認爲NSIndexPath有'row'屬性。顯然,當我檢查indexPath時,它就在那裏。
Kurt
這很好記,Objective-C ...謝謝。 – Kurt