I created UILabel in my .storyboard file, which has some initial movie title text. I connected this UILabel to the property defined in my ViewController files. For some reason, the text will not be displayed in the user interface when the simulator starts. I looked at similar questions, but I did not see an answer that helps.
I have the following property in my .h file
@property (strong, nonatomic) IBOutlet UILabel * movieTitle;
It is synthesized in my .m file
@synthesize movieTitle;
Then I have some code that does the following:
NSLog(@"movie details title in Movie object: %@", _movie.name);
self.movieTitle = [[UILabel alloc] init];
[self.movieTitle setText:self.movie.name];
NSLog(@"movie details title in UILabel.text: %@",self.movieTitle.text);
The console displays the following
movie details title in Movie object: Transformers
movie details title in UILabel.text: Transformers
source
share