开发者

Unable to set the UILabel of a view Controller from a different view Controller

开发者 https://www.devze.com 2023-03-12 02:10 出处:网络
I am trying to set the text label of a second view controller from the current view controller using the following code:

I am trying to set the text label of a second view controller from the current view controller using the following code:

NSString *loadingString =开发者_如何转开发 [NSString stringWithFormat:@"Loading data from Instahotness....."];
self.loadingPage = [[LoadingPageViewController alloc]init];
self.loadingPage.loadingTextLabel.text = loadingString;

NSLog(@"LoadingPage text: %@",self.loadingPage.loadingTextLabel.text);

When I checked the console, the NSLog is returning me a <null> value for the loadingTextLable.text. Is there something I am doing wrong here? Note that in my LoadingPageViewController, I hooked up the UILabel called loadingTextLabel in my xib.


use initWithNibName to initialize LoadingPageViewController.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号