I have a custom cell in UITableView.I have hooked it to a class(DocumentCell)in Identity inspector.The DocumentCell.h class looks like this:
@interface DocumentCell : UITableViewCell
@property(nonatomic,retain) IBOutlet UILabel *lblDocName;
@end
The DocumentCell.m file looks like this:
@implementation DocumentCell
@synthesize lblDocName;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
}
@end
And here's the code for "cellForRowAtIndexPath":
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
//static NSString *CellIdentifier = @"DocumentCell";
DocumentCell *cell = [tableView dequeueReusableCellWithIdentifier:@"DocumentCell"];
if (cell == nil)
{
cell = [[[DocumentCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"DocumentCell"] autorelease];
}
NSLog(@"cell text=%@",[self.myDocList objectAtIndex:indexPath.row]);
cell.lblDocName.text = [self.myDocList objectAtIndex:indexPath.row];
return cell;
}
I am using storyboard.I have hooked the IBOutlet for the cell with the label.The NSLog statement shows the text that should be displayed but the actual table doesn't display the text in the cell.Any idea to solve this?