Hi all,
I'm getting a memory warning: "Incorrect decrement of the reference count of an object that is not owned at this point by the caller" for challengeCell at the marked line.
myIdentifier = @"ChallengTblVwCell";
ChallengeTableViewCell *challengeCell = (ChallengeTableViewCell *)[tableView dequeueReusableCellWithIdentifier:myIdentifier];
if( challengeCell == nil )
{
[[ NSBundle mainBundle ] loadNibNamed:@"ChallengeTableViewCell" owner:self options:nil ];
challengeCell = challengeTblCell;
}
else {
//some code
}
challengeInstance = [genericArray objectAtIndex:indexPath.row];
NSString *challengeTitle = challengeInstance.elecompany;
[challengeCell initWithTitle:challengeTitle subTitle:challengeSubtitle _votes:challengeVotes content:challengeContent _time:challengeTime _image:challengeImage noComments:challengeCommentsNo]; //Warning coming at this line
return (UITableViewCell *)challengeCell;
EDIT:
-(id)initWithTitle:(NSString *)_title content:(NSString *)_content fromName:(NSString *)_fromName _time:(NSString *)_time_ _image:(NSString *)_image_ noComments:(NSInteger)commentsNo
{
//Labels are created through interface builder
[_lbltitle_ setText:_title];
[_lbltime setText:_time_];
[lblcontent setText:_content];
[lblsubTitle setText:_fromName];
[lblnoOfComments setText:[NSString stringWithFormat:@"%d",commentsNo]];
// code for adjusting label height according to content.
return self;
}
I made this separate class for management of cell to make its manipulation easy.
Can anybody please help me resolve this?
Thanx in advance.