2012-02-25 11 views
2

元のindexPath.sectionを特定のUITableViewCellで取得する方法は?これは整数ではなく、文字列を返すだろうと特定のUITableViewCellのセクション番号を取得するには?

NSIndexPath *path = [self.tableView indexPathForCell:cell]; 
return path.section; 

注:

- (NSString *)sectionForCell:(UITableViewCell *)cell { 
    //How to get the original indexPath.section by the specific UITableViewCell? 
} 

答えて

6

のUITableViewはあなたの特定のセルのインデックスパスを与える方法があります。

2

のUITableViewのインスタンスメソッドを使用します

- (NSIndexPath *)indexPathForCell:(UITableViewCell *)cell 
関連する問題