0

I have created a view and now I want to load that view from another viewcontroller without allocating the 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.

2)created IBOutlet for the view and connected.

Now I want to access one property of a view without allocating. Is it possible to do or not.

4

2 回答 2

2

If you've created an IBOutlet and hooked up the view, then you are done. The view is allocated when the xib loads and the reference is placed in the IBOutlet. You can access the view and it's properties through that without doing any allocating yourself.

于 2013-06-18T11:17:45.693 回答
0

加载视图控制器时,连接到它的视图(通过 IBOutlet)也被加载。在这种情况下,您可以访问所有视图的属性。 查看本文

中的“加载 XIB”部分。

于 2013-06-18T11:38:36.513 回答