我刚刚在表格视图中创建了一个自定义单元格,我在 UITableViewDelegate 方法中调用了自定义单元格
--(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
这就是我的代码的样子:
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *cellId = @"cellIdetifier";
static NSString *cellId2 = @"cellId2";
tableCell *customCell = [tableView dequeueReusableCellWithIdentifier:cellId2];
if(customCell == nil){
NSArray *customObjects = [[NSBundle mainBundle]loadNibNamed:@"tableCell" owner:self options:nil];
for(id obj in customObjects){
if([obj isKindOfClass:[tableCell class]]){
customCell = (tableCell *)customObjects;
break;
}
}
}
return customCell;
}
我收到一个错误,上面写着
creatingcustomcell[693:f803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM setTableViewStyle:]: unrecognized selector sent to instance 0x6d6c7f0'
请帮助我,我不知道刚刚发生了什么。