I have a UITableView it is in Prototype mode. I have put 4 labels and 2 text fields into a cell, One of the cell is a basic text entry and works fine.
I have subsclassed the TableViewCell.
Header File
#import <UIKit/UIKit.h>
@interface witLeagueSeriesGameDetailCell : UITableViewCell
@property (strong, nonatomic) IBOutlet UILabel *witGameNumber;
@property (strong, nonatomic) IBOutlet UITextField *witGameScore;
@property (strong, nonatomic) IBOutlet UITextField *witGameResult;
- (void) SetGameResult:(NSString *)resultName;
@end
Implementation File
#import "witLeagueSeriesGameDetailCell.h"
#import "witAppDelegate.h"
@implementation witLeagueSeriesGameDetailCell
@synthesize witGameNumber=_witGameNumber;
@synthesize witGameScore = _witGameScore;
@synthesize witGameResult = _witGameResult;
- (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
}
- (void) SetGameResult:(NSString *)resultName{
NSLog([NSString stringWithFormat:@"%@",resultName]);
//self.witGameResult.text = resultName;
[_witGameResult setText:resultName];
}
@end
The tableview has also been subclassed. It contains a picker that is popping up when the appropriate text field is being entered. When a row is selected it passed the value back to the SetGameResult function, I can see this Using NSLog
However the text for the cell is not updated on the screen.
As can be seen by the code I have tried both the dot notion method and message method for setting the text.
The TVC picker code is
- (void) pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
witLeagueSeriesGameDetailCell *myLabel = [[witLeagueSeriesGameDetailCell alloc] init];
[myLabel SetGameResult:[NSString stringWithFormat:@"%@",[self.statusList objectAtIndex:row]]];
}
Any Ideas on why it may not be showing on the screen
Those are IBOutlets so they ought to be connected to the ones on the storyboard.