我在循环中有这样的数据结构,生成的名为 self.practice 的数组的内容应该在 tableviewController 中填充动态表视图
// new NSDictionary
NSDictionary *highway = [[NSDictionary alloc] initWithObjectsAndKeys:@"Highway", @"description",
@"H", @"namekey",
[NSString stringWithFormat:@"%i", aHours], @"hours",
aHoursDefault.stringValue, @"hoursdefault",
[self.classlist objectAtIndex:i], @"driverclass",
nil];
NSDictionary *freeway = [[NSDictionary alloc] initWithObjectsAndKeys:@"Freeway", @"description",
@"F", @"namekey",
[NSString stringWithFormat:@"%i", fHours], @"hours",
fHoursDefault.stringValue, @"hoursdefault",
[self.classlist objectAtIndex:i], @"driverclass",
nil];
NSDictionary *stateHigway = [[NSDictionary alloc] initWithObjectsAndKeys:@"stateHighway", @"description",
@"S", @"namekey",
[NSString stringWithFormat:@"%i", sHours], @"hours",
sHoursDefault.stringValue, @"hoursdefault",
[self.classlist objectAtIndex:i], @"driverclass",
nil];
// Values of Dictionary assign to array
[self.practiceOverviewData addObject:highway];
[self.practiceOverviewData addObject:freeway];
[self.practiceOverviewData addObject:stateHighway];
// put those arrays in the "Big Array" for my tableview
[self.practice addObject:self.practiceOverviewData];
现在在我的 cellForRowAtIndexPath: 我无法通过内部数组访问键值
cell.textLabel.text = [[self.practice objectAtIndex:indexPath.row] objectForKey:@"description"];