[英]How to load UIView from UIViewcontroller?
I have created a view
and now I want to load that view
from another viewcontroller
without allocating the view
. 我创建了一个
view
,现在我想从另一个viewcontroller
加载该view
而不分配view
。 Is it possible or not. 有可能吗? please clarify me.
请澄清我。
I am doing like following 我喜欢跟随
1)Added UIView
in viewcontroller.xib and given view class name for the view
. 1)在viewcontroller.xib中添加了
UIView
,并为view
指定了视图类名。
2)created IBOutlet for the view
and connected. 2)为
view
创建IBOutlet并连接。
Now I want to access one property of a view
without allocating. 现在我想在不分配的情况下访问
view
一个属性。 Is it possible to do or not. 有可能做或不做。
If you've created an IBOutlet and hooked up the view, then you are done. 如果你已经创建了一个IBOutlet并连接了视图,那么你就完成了。 The view is allocated when the xib loads and the reference is placed in the IBOutlet.
当xib加载并且引用放在IBOutlet中时,将分配视图。 You can access the view and it's properties through that without doing any allocating yourself.
您可以通过它访问视图及其属性,而无需自行分配。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.