Re: [iOS] setting table style for root view controller of a navigation controller
Re: [iOS] setting table style for root view controller of a navigation controller
- Subject: Re: [iOS] setting table style for root view controller of a navigation controller
- From: glenn andreas <email@hidden>
- Date: Thu, 02 Dec 2010 13:33:49 -0600
On Dec 2, 2010, at 11:47 AM, Matt Neuburg wrote:
>
> On Dec 1, 2010, at 6:58 PM, Donald Hall wrote:
>
>> I have come to the conclusion that what I wanted to do is not easily done unless the table view controller has its own nib file. In IB if you don't specify that the table view controller that is the root view controller of a navigation controller has its own nib file, there is no access to the actual table view in IB, so no way there to specify the table style. (The inspector window for a table view controller has no setting to specify the style.) Hitting the disclosure triangle for the custom table view controller in the main window nib file in that case only shows the Navigation Item - it doesn't show the table view. To access the controller's table view you have to have a separate nib file for the table view controller and tell the main window nib in the Attributes Inspector to load from this other nib.
>
> This just isn't so. You say "Hitting the disclosure triangle for the custom table view controller in the main window nib file in that case only shows the Navigation Item - it doesn't show the table view." It doesn't show the table view because you didn't put any table view there. If you drag a table view into the table view controller, that becomes its view and now you can hook everything up. This is in some ways not as convenient as putting the table view in its own nib file, but you can certainly do it that way.
>
> My own inclination, however, would be to go exactly the other way - no second nib, no table view in any nib, and no UITableViewController in a nib either. In fact, I probably wouldn't even use a UITableViewController at all. UITableViewController doesn't get you anything much that you can't do in code yourself.
Actually, it does a number of things for you:
1) It flashes the scroll bar correctly when the view appears
2) It can automatically deselect selected rows (in 3.2 and later)
3) Most importantly, it will handle dealing with keyboards showing up and covering part of the table view (and adjust the scroll/content inset), which can be a painful mess, especially trying to support both pre 3.2, and 3.2/4.x (since not only are the keyboard notifications different, but it deals with the view being presented in the variety of different ways - sheet, full screen, etc...)
Glenn Andreas email@hidden
The most merciful thing in the world ... is the inability of the human mind to correlate all its contents - HPL
_______________________________________________
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