UILabel not updating

后端 未结 5 1184
太阳男子
太阳男子 2021-01-02 10:38

Sorry the basic question, but this bugs me for a while now.

I create a details view from a UITable and try to dynamically set its labels, but they are not updating:

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-02 11:18

    Is it not because your NSLog is trying to print out the actual label object. Should you not have

    NSLog(@"%@", tmpVC.myLabel.text);
    

    In Response to the added information: Your other issue would appear to be that you have linked an NSString to your label. You have to link it to a UILabel. So where you declare your myLabel var, change it to UILabel *myLabel, and the same for any matching property.

提交回复
热议问题