Re: How do you enable a view controller to be instantiated programmatically or from a XIB?
Re: How do you enable a view controller to be instantiated programmatically or from a XIB?
- Subject: Re: How do you enable a view controller to be instantiated programmatically or from a XIB?
- From: Uli Kusterer <email@hidden>
- Date: Sat, 24 Sep 2011 23:19:13 +0200
On 24.09.2011, at 08:02, G S wrote:
> So is it not practical to have a view controller that can be
> instantiated either way? If it is practical, how would one do it?
> Explicitly load from a previously specified XIB in loadView?
I think you may be conflating two things here:
1) The *view controller object itself* being instantiated by a XIB (i.e. another XIB owned by another view controller, or the Main.xib) or manually
2) The views *inside* the view controller being instantiated through a XIB or manually
#1 is certainly possible, and not at all a problem. You just create your view controller class, then in the "parent" XIB drag a view controller from the palette, hook it up to some outlet (so you can talk to it in some way), and set its custom class to your view controller's class.
#2 seems kind of pointless to me, because if you've already created code that populates the view controller manually, why would you want to create a XIB as well?
Maybe I'm just not understanding what you're trying to do. What are you doing, and at what point are you having a problem?
Cheers,
-- Uli Kusterer
http://stacksmith.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden