How do I create a view with a picker on the bottom and a table view on the top?

Posted by Andy on Stack Overflow See other posts from Stack Overflow or by Andy
Published on 2010-03-27T02:36:10Z Indexed on 2010/03/27 2:43 UTC
Read the original article Hit count: 221

Hi - first time asker, long-time lurker.

I am trying to create an iPhone view that has a date/time picker on the bottom half of the screen, and a grouped, single-section, four-row table view on the top half of the screen (almost identical to the one Apple shows in Fig. 2-4 of their View Controller Programming Guide (but then never goes on to explain).

Conceptually, I think I understand that what I need is a main view with a pair of subviews - one for the picker, and one for the table view. I'm pretty sure I can make the picker function once I have it on-screen, and I'm pretty sure I can make the table view function too. What I can't for the life of me figure out is how, programmatically speaking, to get the two views onto the screen simultaneously. I can lay it out perfectly in Interface Builder, but then it all goes to hell when I switch to Xcode...the view appears with the picker, but no table view.

Thanks, in advance, for any help you can offer.

© Stack Overflow or respective owner

Related posts about iphone-sdk

Related posts about cocoa-touch