在下面的代码中,我确定一切正常,直到[tableView reloadData]我已经在表视图委托方法中设置NSLOGs,并没有被调用。我有其他方法做相同的reloadData,它完美的作品。我失去的唯一区别是这是在@catch块。也许你聪明的家伙可以看到的东西,我做错了......iphone重载表查看
@catch (NSException * e) {////chart is user genrated
logoView.image = nil;
NSInteger row = [picker selectedRowInComponent:0];
NSString *selectedAircraft = [aircraft objectAtIndex:row];
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *docsPath = [paths objectAtIndex:0];
NSString *checklistPath = [[NSString alloc]initWithFormat:@"%@/%@.checklist",docsPath,selectedAircraft];
NSString *dataString = [NSString stringWithContentsOfFile:checklistPath encoding: NSUTF8StringEncoding error:NULL];
if ([dataString hasPrefix:@"\n"]) {
dataString = [dataString substringFromIndex:1];
}
NSArray *tempArray = [dataString componentsSeparatedByString:@"\n"];
NSDictionary *temporaryDictionary = [NSDictionary dictionaryWithObject: tempArray forKey:@"User Generated Checklist"];
self.names = temporaryDictionary;
NSArray *tempArray2 = [NSArray arrayWithObject:@"01User Generated Checklist"];
self.keys = tempArray2;
aircraftLabel.text = selectedAircraft;
checklistSelectPanel.hidden = YES;
[tableView reloadData];
}
这可能不会帮助,但只是出于好奇,你尝试过使用'self.tableView',而不是'tableView'? – shosti 2010-05-18 02:33:41