这就是我目前在WatchKit中填充表格视图的方式:
- (void)awakeWithContext:(id)context {
[super awakeWithContext:context];
// Configure interface objects here.
menuItems = [[NSMutableArray alloc] initWithObjects:@"Pizza", @"Chicken", @"Bread", nil];
for (NSString *item in menuItems)
{
MenuRowController *menuRow = [myTableView rowControllerAtIndex:[menuItems indexOfObject:item]];
[menuRow.menuItemLabel setText:item];
}
}
我收到以下错误:
Extension[980:19597] Error - attempt to ask for row 0. Valid range is 0..0
Printing description of item:
Pizza
2015-07-05 01:58:07.284 ScanBarWatch WatchKit Extension[980:19597] Error - attempt to ask for row 1. Valid range is 0..0
2015-07-05 01:58:14.780 ScanBarWatch WatchKit Extension[980:19597] Error - attempt to ask for row 2. Valid range is 0..0
我尝试在线查找此错误几个小时但无济于事。似乎没有人有解决方案。