我有我合成一對夫婦的字符串:問題的UITableView的委託
.H
@property(nonatomic,copy) NSString* bio;
.M
@synthesize bio;
//connectionDidFinish method
bio = [[[profile objectForKey:@"user"] valueForKey:@"profile"] valueForKey:@"bio"];
當我的tableview首次加載我得到一個錯誤-[NSNull length]: unrecognized selector sent to instance 0x11d45e8
in cellForRowAtIndexPath:
case kBioSectionDescriptionRow:
if ([bio length]==0 ||bio == nil) {
cell.textLabel.text = @"bio";
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.detailTextLabel.numberOfLines = 5;
cell.detailTextLabel.font = [UIFont fontWithName:@"Helvetica Neue" size:(14.0)];
cell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
cell.detailTextLabel.text = @"None";
}
else{
cell.textLabel.text = @"bio";
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.detailTextLabel.numberOfLines = 5;
cell.detailTextLabel.font = [UIFont fontWithName:@"Helvetica Neue" size:(14.0)];
cell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
cell.detailTextLabel.text = [NSString stringWithFormat: @"%@", bio];
}
break;
我怎樣才能確保我的生物分配而不是空?