I Know this question is asked again and again here, but did not find any solutions for my problem.I'm creating a Custom UITableViewCell through xib and trying to load it.in my VC called ACSummaryVC
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"SimpleTableCell";
AcSummaryCell *cell = (AcSummaryCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"AcSummaryCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
}
AcSummaryCell is a subclass of UITableViewCell
and it has an UILabel
IBOutlate called acLabel.when i compile the project i get following error-
`Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ACSummaryVC 0x71465c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key acLabel.'`
i have created connection of acLabel in AcSummayCell class, but i'm getting error from ACSummaryVC? What i'm doing wrong?
Edit:- according to Mani's answer bellow i'm connecting outlate to file owner and it is wrong instead i've to connect outlate to custom cell.but when i try this i did not get my outlate to connect with instead i'm getting like this image -
Now question is How to connect my outlate with custom cell? here is my AcSummayCell.h
@interface AcSummayCell : UITableViewCell
@property(nonatomic, retain)IBOutlet UILabel* acLabel;
@property(nonatomic, retain)IBOutlet UILabel* namelbl;
@property(nonatomic, retain)IBOutlet UILabel* cBalancelbl;
@property(nonatomic, retain)IBOutlet UILabel* avBalancelbl;
and AcSummayCell.m
#import "AcSummayCell.h"
@implementation AcSummayCell
@synthesize acLabel = _acLabel;
@synthesize namelbl = _namelbl;
@synthesize cBalancelbl = _cBalancelbl;
@synthesize avBalancelbl = _avBalancelbl;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end