简体   繁体   English

奥特莱斯出现零

[英]Outlets are showing nil

I outleted some views and buttons. 我发布了一些视图和按钮。 and make synthesised to it on .m file. 并在.m文件中合成它。 outlet properties are (strong,nonatomic) though when I try to access it on viewwillappear it is showing (nil) . 出口属性是(strong,nonatomic)但是当我尝试在viewwillappear上访问它时它显示(nil) Can anyone help me that how could I access it? 任何人都可以帮助我,我怎么能访问它? thanks in advance. 提前致谢。

Go into your Storyboard file, right-click on the offending control, and make sure that you have a variable name shown under "Referencing Outlets". 进入Storyboard文件,右键单击有问题的控件,并确保在“Referencing Outlets”下显示变量名称。

If it's not... the control isn't bound to a variable, and that'd explain your nil. 如果它不是......控件没有绑定到变量,那就解释你的零。

在此输入图像描述

You can also go into your .h file, and check that your IBOutlet s all have filled in circles to the left of them. 您也可以进入.h文件,并检查您的IBOutlet是否已填入左侧的圆圈。 This also tells you that they are bound to a control. 这也告诉你它们被绑定到一个控件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM