How to integrate a picker and a table view?

Discussion in 'iOS Programming' started by ataylor2009, Mar 25, 2010.

  1. ataylor2009 macrumors member

    Joined:
    Jan 27, 2009
    #1
    Original post from a few days ago:

    It's been a few days, and apparently none of you can remember where I saw the sample code, either...:) So, allow me to rephrase my question: Conceptually speaking, how would you go about constructing this view (i.e. picker + table view rows)? Pretty much all of my Objective-C / Cocoa / iPhone programming has centered around Xcode's templates with minor modifications where necessary; this seems like it's going to be more of an in-depth change, though. Am I supposed to start with an empty view, and then add a picker and a table view to it as subviews, and then push the whole thing? If so, can this be constructed in IB, or must it be done in code?

    Or do I have it completely wrong, and there's some other way to build this view (for an example, go to iCal on the iPhone and tap "add" then the "Starts / Ends" row; the resulting view is close to what I'm shooting for)? Again, thanks in advance for your help; I couldn't have gotten as far as I have without the generosity of the folks around here (and I haven't even gotten very far yet, as evidenced by this post).
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    UIViewController subclass that creates the two views in code with the appropriate frames and adds them to an overall UIView. The custom UIViewController subclass can implement both sets of delegate/datasource methods.
     

Share This Page