-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的值。
非常感谢。
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的值。
非常感谢。
你是如何给单行分配多个单元格的?我认为你不能。 cellForRowAtIndexPath
应该只返回一个UITableViewCell
实例。
注:
您可以使用下面的代码
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:nowIndex];
我假设你正在使用的NSArray得到一个specic排
UITableViewCell
,你怎么定义的呢? –arrayLocations = [[NSMutableArray alloc] initWithCapacity:99]; –
然后从数据库中提取内容: 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]; } –