2014-01-25 47 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]; 
相关问题