I am building a simple Navigation-based app using tables.
I have a custom "UITableViewCell" to customize the table cell data attached below.
@interface NewsCell : UITableViewCell
{
IBOutlet UILabel *newsTitle;
}
- (void)setNewsLabel:(NSString *)title;
@end
And then in my RootViewController, I set the text of the label "newsTitle" in "cellForRowAtIndexPath" method as follows.
static NSString *MyIdentifier = @"MyIdentifier";
MyIdentifier = @"NewsCell";
NewsCell *cell = (NewsCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if(cell == nil)
{
[[NSBundle mainBundle] loadNibNamed:@"NewsCell" owner:self options:nil];
cell = newsCell;
}
[cell setNewsLabel:@"hello testing"];
return cell;
When I run this, the app runs fine, but I get "NewsCell may not respond to '-setNewsLabel:'" warning.
Please help! Thank you.