Default Help With TabBar (Navigation/Table Views)

Discussion in 'iOS Programming' started by nightcrawler234, Sep 15, 2010.

  1. nightcrawler234 macrumors newbie

    Jul 21, 2010

    I have been watching this tutorial:

    I downloaded this sample code here:

    Basically, it allows you to create and save events to your iCal through the new EventKit framework available for iOS 4.

    What I want to do is incorporate the above sample code into a tab bar.

    I've tried my best at trying to implement this functionality, but I'm not sure exactly how to do this. I am not getting the desired result....

    Here's what I have:

    Appreciate it if someone could help me out.
  2. adrian.oconnor macrumors 6502

    Jan 16, 2008
    Nottingham, England
    What does your RootViewController.xib look like? There's probably an empty view in there.
  3. nightcrawler234 thread starter macrumors newbie

    Jul 21, 2010
    It's a table view.

    I was basing my code from the sample Ekevent demo code. if I have a table view, the rest should be added progromatically right?

    Appreciate it if you could download the sample code I posted and try it out.
  4. adrian.oconnor macrumors 6502

    Jan 16, 2008
    Nottingham, England
    OK, it's not that difficult, I think you probably either didn't create a variable in your appdelegate for the tabbarcontroller, or you didn't wire it up in IB, or you didn't set it to be the view that gets displayed.

    You are right by the way, the table does get programatically generated, but the fact that you had a pure white screen was a clue that IB stuff isn't getting added to the window's view.

    I downloaded the sample and changed it like this:

    1. Added a tabbarviewcontroller to the IB project.
    2. Dragged the existing navigationcontroller in to the tabbarviewcontroller -- it becomes a tab.
    3. Created a variable and a property for the tabbarcontroller in the appdelegate .h
    4. Synthesized the property and made it the view that is added to the window instead of the navigationcontroller.
    5. In IB, connected the tabbarcontroller to the property in the app delegate.

    That's it. I've arranged my windows and grabbed it all so you can see everything at once, including the working app.

Share This Page