小编Adn*_*hry的帖子

UITableView内容"静态单元格"在iOS7中不起作用

我的故事板有问题.它工作正常但是当我尝试更改UITableView的内容属性时导致以下错误

断言失败 - [UITableView dequeueReusableCellWithIdentifier:forIndexPath:],/ SourceCache/UIKit/UIKit-2903.23/UITableView.m由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'无法使用标识符Cell将单元格出列 - 必须注册一个笔尖或标识符的类或连接故事板中的原型单元格'

我想用静态单元格设计一个分组的tableview.Thanks提前

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 
{ 
// Return the number of sections. 
return 2; 
} 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{ 
return 3; 
} 
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
static NSString *CellIdentifier = @"Cell"; 
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; 
return cell; 
} 
Run Code Online (Sandbox Code Playgroud)

iphone ios7 xcode5

6
推荐指数
3
解决办法
1万
查看次数

标签 统计

ios7 ×1

iphone ×1

xcode5 ×1