2014-01-25 46 views
-1

Xcode中是否有一個允許您返回特定行中特定單元格的值的命令?Objective C數組返回特定​​行的單元格值

Row 1 | Cell 1 | Cell 2 | Cell 3 
Row 2 | Cell 1 | Cell 2 | Cell 3 
Row 3 | Cell 1 | Cell 2 | Cell 3 

例如,我希望第3行中的Cell 3的值。

非常感謝。

+0

我假設你正在使用的NSArray得到一個specic排UITableViewCell,你怎麼定義的呢? –

+0

arrayLocations = [[NSMutableArray alloc] initWithCapacity:99]; –

+0

然後從數據庫中提取內容: while([results next]){ recno ++; classLocations * locations = [[classLocations alloc] init]; locations.locationID = [results intForColumn:@「ID」]; locations.location = [結果stringForColumn:@「NAME」]; locations.longitude = [結果stringForColumn:@「LONGITUDETEXT」]; locations.latitude = [結果stringForColumn:@「LATITUDETEXT」]; locations.altitude = [結果stringForColumn:@「ALTITUDETEXT」]; [arrayLocations addObject:locations]; } –

回答

1

你是如何給單行分配多個單元格的?我認爲你不能。 cellForRowAtIndexPath應該只返回一個UITableViewCell實例。

注:

您可以使用下面的代碼

UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:nowIndex]; 
相關問題