UILabel text is not displayed, but the value of "text" is updated (displayed in the console)

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
+5
source share
3 answers

, text . , , . UIKit .

UILabel, IBOutlet Interface Builder.

+6

movieTitle UILabel;, :

self.movieTitle = [[UILabel alloc] init];

UILabel, , .

, . :

NSLog(@"movie details title in Movie object: %@", _movie.name);
[self.movieTitle setText:self.movie.name];
NSLog(@"movie details title in UILabel.text: %@",self.movieTitle.text);
+3

, .

, . , . , .xib Retina 4 Full Screen, ( ) 5.0, , ( ), iPhone 5.0, 3,5 . , 3,5 ". , .

, .

+2

All Articles