【发布时间】:2012-01-19 18:00:48
【问题描述】:
我尝试运行我的应用程序,但在 Main.m 文件和此日志消息中收到了信号 SIGABRT。帮忙?
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '- [UITableViewController loadView] loaded the "5wY-6u-SFr-view-Zew-TR-1Cy" nib but didn't get a UITableView.'
*** First throw call stack:
(0x15d3052 0x1764d0a 0x157ba78 0x157b9e9 0x2536ae 0xea5cb 0xf358c 0xee3e8 0x307cc5 0xf1427 0xf158c 0xb6f5280 0xf15cc 0x4546b6 0x448e30 0x15d4ec9 0x275c2 0x2755a 0xccb76 0xcd03f 0xcc2fe 0x4ca30 0x4cc56 0x33384 0x26aa9 0x14bdfa9 0x15a71c5 0x150c022 0x150a90a 0x1509db4 0x1509ccb 0x14bc879 0x14bc93e 0x24a9b 0x1d42 0x1cb5)
terminate called throwing an exception
这是我的表格视图的代码:
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return [self.menu count];
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell =[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text = [[self.menu objectAtIndex:indexPath.row]objectForKey:@"Title"];
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *__strong)indexPath {
DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"detailViewController"bundle:nil];
OrderViewController *orderViewController = [[OrderViewController alloc] initWithNibName:@"orderViewController"bundle:nil];
detailViewController.item = [self.menu objectAtIndex:indexPath.row];
orderViewController.itemString = [self.menu objectAtIndex:indexPath.row];
[self.navigationController pushViewController:detailViewController animated:YES];
}
【问题讨论】:
-
好像你的 tableView 没有连接到你的插座。
-
或者 xib 以某种方式损坏。
-
如何将 tableview 连接到插座?
-
可能是您的 tableview 是从 nib 加载的,因此请将您的 tableview 名称与 nib 文件连接。
标签: ios xcode uitableview dictionary sigabrt