I am trying to set a label text with the text i selected from my tableview. Here are my codes
- (void)viewDidLoad
{
// Location *l = [[Location alloc]init];
// [l view];
[super viewDidLoad];
// Do any additional setup after loading the view.
[pLabel setText:[self selectedText]];
NSLog(@"%@1", [self selectedText]);
}
-(id) initWithTextSelected:(NSString *) text {
self.selectedText = text;
[pLabel setText:selectedText];
NSLog(@"%@2", [self selectedText]);
return self;
}
I can't seem to set my label. In addition, NSLog 1 prints out null while NSLog 2 displayed my selected value.