Re: UINavigationController subclass won't load its nib.
Re: UINavigationController subclass won't load its nib.
- Subject: Re: UINavigationController subclass won't load its nib.
- From: David Duncan <email@hidden>
- Date: Fri, 11 Oct 2013 11:37:08 -0700
I think your approach is wrong. It doesn’t sound like you have a specialized navigation controller, but rather a navigation controller that has a specialized UI. The way to approach that problem is to load a UIViewController subclass with that logic in it, and create a UINavigationController with that custom view controller as its root view controller.
If you have further specialized logic that needs to know about both the navigation controller and its view controllers, then you can create an additional class to manage that work, but you almost certainly don’t want it to be a navigation controller subclass.
On Oct 11, 2013, at 2:12 AM, Half Activist <email@hidden> wrote:
> Hi,
>
> To put it shortly, my UINavigationController doesn't load its assigned NIB at all.
>
> I've got an UINavigationController subclass that contains the code for an object inspector in an app i'm writing.
> It's declared as the file's owner of a nib of the same name, this nib helps me build the ui of the various subviews pushed as details of some parameter, selected on a root table view. (ie a somewhat classical way for an inspector on ios).
> Now, I instantiate my view controller with:
>
> [ [ MyNavController alloc ] initWithNibName: @"MyNavController" bundle: nil ];
>
> And display it in a popover.
>
> The popover remains empty.
> loadView is called but it doesn"t not contain the root view assigned in IB.
> None of my outlets are populated, I overloaded some setters, they aren't called at all.
> All other objects aren't instantiated by the way...
> ...Therefore I guess the NIB isn't even loaded!
>
> To rule out a potential resource loading error, I wrote a nib loading method of mine using UINib.
> And it works, the NIB is correct, everything is correct. Except that UINavigationController doesn't want to load its assigned NIB.
>
> Regards.
> _______________________________________________
>
> 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
--
David Duncan
_______________________________________________
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