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: Matt Neuburg <email@hidden>
- Date: Thu, 2 Dec 2010 09:47:59 -0800
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. Personally I'd just use my own UIViewController subclass, and create the table view in code. And in that case I probably wouldn't instantiate the UIViewController subclass from a nib either; I'd do *that* in code as well. It seems to me that you're stumbling over your feet in part because you insist on doing everything in nibs. In my view, nib instantiation and configuration of view controllers just makes it harder to understand what's going on. m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.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