好了,所以我創建的IB定製uitablviewcell,我已經創建了被稱爲CustomCell 我已經在頭文件導入後,這裏的類是一些代碼申請成員變量的東西不是一個結構
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"CustomCell";
CustomCell *cell = (CustomCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
for (id currentObject in topLevelObjects){
if ([currentObject isKindOfClass:[UITableViewCell class]]){
cell = (CustomCell *) currentObject;
break;
}
}
}
//errors start
cell.usernameText.text = [usernameArray objectAtIndex:[indexPath row]];
cell.regionText.text = [regionArray objectAtIndex:[indexPath row]];
cell.gamesText.text = [gamesArray objectAtIndex:[indexPath row]];
cell.infoText.text = [aboutArray objectAtIndex:[indexPath row]];
cell.concoleText.text = [concoleArray objectAtIndex:[indexPath row]];
cell.micText.text = [NSString stringWithFormat:@"Mic:%@",[MicArray objectAtIndex:[indexPath row]]];
cell.ageText.text = [ageArray objectAtIndex:[indexPath row]];
//till her
return cell;
}
爲什麼會出現錯誤,我該如何解決它。
使用'@interface CustomCell'發佈代碼? – Nekto