[Help Please] UITableView Befuddlement

Discussion in 'iOS Development' started by cocotutch, Jun 11, 2009.

  1. cocotutch

    cocotutch Community Development Team Staff Member

    Joined:
    Oct 6, 2008
    Messages:
    1,285
    Likes Received:
    117
    Device:
    5G iPod touch
    Hi there all,

    I have been experimenting in Cocoa/iPhone SDK over the past few months, and I have made "Demo" (See Theme WIP thread), but I really want to make a UITableView, Navigation Based App. I followed this tutorial:

    Click Here for the Tutorial

    And it worked great, but I have three views, and I want the UITableView to load them when I press the appropriate button. For example:

    UITableView:

    Cell 1: Volume
    Cell 2: Timetable/Shake/Alerts and crap
    Cell 3: About

    Clicking on About would bring up the About View which is under another view controller and xib. Do I have to put all my views in the one XIB and in the same View Controller?

    Help would be great, thanks all.

    CT
  2. NolesFans

    NolesFans New Member

    Joined:
    Sep 23, 2008
    Messages:
    404
    Likes Received:
    0
    Device:
    iPod touch
    each View has to be own XIB. on About part, it need to be pushViewController?
  3. cocotutch

    cocotutch Community Development Team Staff Member

    Joined:
    Oct 6, 2008
    Messages:
    1,285
    Likes Received:
    117
    Device:
    5G iPod touch
    I have my own XIBS and View Controllers for my subviews which I want to load. But the tutorial put all the views into an Array, and I don't know how to load them, its annoying. Anything else? Thanks

    Please Register or Log in to view images

    Please Register or Log in to view images



    CT
  4. jamil_d

    jamil_d Active Member

    Joined:
    Dec 15, 2007
    Messages:
    2,041
    Likes Received:
    12
    Device:
    iPhone 3GS (Black)
    The thing that helped me with this was actually sample code from Apple's site. I believe the sample code "NavBar" would help.
  5. cocotutch

    cocotutch Community Development Team Staff Member

    Joined:
    Oct 6, 2008
    Messages:
    1,285
    Likes Received:
    117
    Device:
    5G iPod touch
    Oh no, the pushing works and it is a Nav based app already, it just keeps loading the same view no matter what cell i pick

    Please Register or Log in to view images

  6. jamil_d

    jamil_d Active Member

    Joined:
    Dec 15, 2007
    Messages:
    2,041
    Likes Received:
    12
    Device:
    iPhone 3GS (Black)
    Try the one in the example, worked perfectly for me, and since it is Apple-made, you know it's perfect code.
  7. bamhm182

    bamhm182 Member

    Joined:
    Mar 2, 2009
    Messages:
    544
    Likes Received:
    0
    Device:
    3G iPod touch
    You helped me out, so I figured I'd help you out. This tutorial was a LOT of help in me figuring out Table Views.

    I'm assuming you will want something like this, right?

    http://www.[PIRACY.mf].com/?mykkozuixjm

    I you can change how everything looks fairly easily, and as for it using an array, it defines the array in -(void)awakeFromNib, so if you just change the definitions, you get different cells. If that didn't make sense, in the tutorials example, they were all set as:

    SubviewViewController *subviewViewController

    In my example, you have:

    VolumeViewController *volumeViewController
    TimetablesViewController *timetablesViewController
    AboutViewController *aboutViewController
  8. cocotutch

    cocotutch Community Development Team Staff Member

    Joined:
    Oct 6, 2008
    Messages:
    1,285
    Likes Received:
    117
    Device:
    5G iPod touch
    Thankyou!, Thankyou!, Thankyou!, Thankyou!, Thankyou!, Thankyou!, Thankyou!, Thankyou!, Thankyou!, Thankyou!, Thankyou!, Thankyou!!!!!!!!!!!!!! That was exactly what I needed. The funny thing is, the Array is set up exactly how I tried to do it from that Tutorial template I found on the internet, it's a little crazy, but the App is looking very good now, Thankyou again!

    CT

    +1 Kudos for Bamhm182

    Please Register or Log in to view images

  9. bamhm182

    bamhm182 Member

    Joined:
    Mar 2, 2009
    Messages:
    544
    Likes Received:
    0
    Device:
    3G iPod touch
    No problem. I'm glad any time I can help.

    Please Register or Log in to view images

    I was somewhat surprised that I was able to figure it out.

    Please Register or Log in to view images

Share This Page