我正在尝试为我的UITableView制作自定义单元格.
所以,我创建了一个类(UITableViewCell),并命名为HomeCell.该类有一个xib文件,标签名为titleCell.
在我的cellForRowAtIndexPath方法中,我写道:
HomeCell *cell = (HomeCell *)[tableView dequeueReusableCellWithIdentifier:@"HomeCell"]; if(cell == nil){ NSArray *xib = [[NSBundle mainBundle] loadNibNamed:@"HomeCell" owner:self options:nil]; for(id oneObject in xib){ if([oneObject isKindOfClass:[HomeCell class]]){ cell = (HomeCell *) oneObject; } } } //Get object at index data HomeObjectCell *tempObject = [self.dataForCell objectAtIndex:indexPath.row]; NSLog(@"Title : %@",tempObject.title); // The tempObject.title return a NSString example cell.titleCell.text = tempObject.title; // <-- ERROR !
当我运行应用程序时,我得到了:
[UITableViewCell titleCell]: unrecognized selector sent to instance 0x6e61890
任何的想法?