SetHidden not working [duplicate]

大兔子大兔子 提交于 2020-01-15 08:18:05

问题


I am developing an application in cocoa.I need to hide a progress bar placed in an NSView and show an NSTextfield in that place .I used the following cod [progressbar setHidden:TRUE] [textfield setHidden:FALSE]; But this code snippet is not working. Is that a bug.??I used to hide the same code to hide certain other text fields in the same page .But that controls became hidden.looking for a solution...


回答1:


Are progressbar and textfield outlets ? If yes, make sure they are correctly connected in your nib. Also make sure that you call setHidden: from the main thread.

And unrelated to your problem, in Objective-C you should use YES instead of TRUE and NO instead of FALSE.



来源:https://stackoverflow.com/questions/1194888/sethidden-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!