Tyl*_*itt 6 iphone xcode uitableview ios xcode4.2
我正在尝试使用Xcode 4.2的新StoryBoard功能,并在将表视图与自定义单元格一起使用时不断出现此错误.
cell reuse indentifier in nib (Cell) does not match the identifier used to register the nib (ThisCell)
我已将自定义单元格的类设置为自定义UITableViewCell类,并在IB中将标识符设置为"ThisCell".
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"ThisCell";
//TableViewCell *cell = (TableViewCell*)[tableView dequeueReusableCellWithIdentifier:@"ThisCell"];
TableViewCell *cell = (TableViewCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
return cell;
Run Code Online (Sandbox Code Playgroud)
我不知道"Cell"来自哪里.有任何想法吗?我尝试在另一个项目中加载一个自定义单元格,它似乎工作正常,我只是找不到有关此错误的任何文档,以找出我在当前项目中搞砸了什么.
谢谢
Dun*_*age 13
错误消息指出在您的nib中单元格被标识为"Cell" - 您需要查找定义自定义单元格的xib文件以配置Cell Reuse标识符,并将其设置为ThisCell ...或者只需更改ThisCell在此代码中单元格.
| 归档时间: |
|
| 查看次数: |
6774 次 |
| 最近记录: |