Watchkit 扩展中有一个方法可以在 tableview 中显示项目。大约有 500 多个项目,内存从 2.9mb 增加到 7.8mb,手表应用程序崩溃。方法如下:
[_timeTable setNumberOfRows:timeCardArray.count withRowType:kWDTimeRow];
[timeCardArray enumerateObjectsUsingBlock:^(WDTime *timeCard, NSUInteger index, BOOL *stop) {
WDTimeRowController *timeRow = [_timeTable rowControllerAtIndex:index];
[timeRow configureWithData:timeCard delegate:self atIndex:index];
}];
在设备日志中,我可以看到这条消息“watchkitapp 未能及时更新场景”
如何修复此崩溃?是内存造成的还是手表tableview加载500项的等待时间过长?