我不明白为什么我的 UITableView
有时不能正常显示。它提示“Thread 1: Program received signal: "SIGABRT"
.
PS:condTempTableViewCell
是带有 IBOutlet
控件的自定义 UITableViewCell
。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([indexPath section] == 1)
return self.condTempTableViewCell;
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
// Configure the cell...
cell.textLabel.text = [condStatusArray objectAtIndex:[indexPath row]];
return cell;
}
有什么帮助吗?
最佳答案
先启用nszombie然后找出问题所在
Double-click an executable in the Executables group of your Xcode project.
Click the Arguments tab.
In the "Variables to be set in the environment:" section, make a variable called "NSZombieEnabled" and set its value to "YES".
和自定义单元格
if ([indexPath section] == 1) {
static NSString *CellIdentifier = @"CustomCell";
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
for (id oneObject in nib) {
if ([oneObject isKindOfClass:[CustomCell class]]) {
cell = (CustomCell *)oneObject;
break;
}
}
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
}
return cell;
自定义单元格返回类似这样的东西
祝你好运
关于iphone - UITableView 还是 UITableViewCell?提示 "Thread 1: Program received signal: "SIGABRT”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5619122/