How to load a UIView from a NIB?
Posted
by Winder
on Stack Overflow
See other posts from Stack Overflow
or by Winder
Published on 2010-04-15T19:20:36Z
Indexed on
2010/04/15
21:43 UTC
Read the original article
Hit count: 863
I have been using UIViewController
s and initWithNibName
with much success, basically using them as a convenient way to design the view with Interface Builder. Unfortunately I have built a hierarchy of views before noticing this line in the UIViewController
documentation:
Note: You should not use view controllers to manage views that fill only a part of their window
My question is this: Having a very simple NIB that only has a UIView in addition to the default First Responder and Owning Object, what is the simplest way to load the UIView into my code?
I have not been able to get loadNibNamed:owner:options:
to work at this point, but suspect the answer will involve it somehow.
© Stack Overflow or respective owner