On Jan 25, 2011, at 2:11 PM, WT wrote:
> On Jan 25, 2011, at 6:41 PM, Matt Neuburg wrote:
> 
>> You asked for further support from the documentation for my statement that 
>> you're using view controllers for views that are going into the wrong sort 
>> of place in your view hierarchy. The devil can quote scripture for his own 
>> purposes, but since one of the view controllers you're misusing is a 
>> UINavigationController, I'll just paste in, directly from the docs, this 
>> convenient list of the places where such a controller is permitted:
>> 
>>      • Install it directly in your application’s main window.
>>      • Install it as the root view controller of a tab in a tab bar 
>> interface.
>>      • Install it as one of the two root view controllers in a split view 
>> interface. (iPad only)
>>      • Present it modally or otherwise use it as a standalone view 
>> controller that you can display and dismiss as needed.
>>      • Display it from a popover. (iPad only)
>> 
>> The place you're putting it is none of those.
> 
> On the contrary. The navigation controller *is* installed as the root view 
> controller of a tab in a tab bar interface. It's installed as the root view 
> controller of tab 0 of the window's root view controller (which implements a 
> tab bar interface).

I don't have your original message any more, but my understanding is that you 
have rolled your own tab bar controller. When the docs say that a 
UINavigationController can be a tab in a tab bar interface, they mean a 
UITabBarController, not a UIViewController that happens to implement a tab bar 
interface. Apple engineers have access to private APIs that we do not, that 
lets them make UINavigationControllers work well with UITabBarControllers. You 
do not have that, which is why trying to put a UINavigationController into a 
UIViewController of your own design is going to cause you problems.

> In order to accomplish that, I need to be able to change the tab bar's 
> delegate and list of items and restore them when the navigation controller 
> returns to its root view. A tab bar managed by a UITabBarController cannot 
> have its delegate changed, so I'm faking a UITabBarController.

I tend to agree with others that displaying the experiment modally might be a 
better UI, but if you don't want to do that, you should still be able to use a 
UITabBarController and just call -setViewControllers:animated: to change the 
contents to the tab bar. Just make sure you implement -tabBarItem for each of 
the view controllers in the array so that you get icons in the tab bar and not 
just text.

-- 
Dave Carrigan
d...@openshut.net
Seattle, WA, USA

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to