Default Help With TabBar (Navigation/Table Views)

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

  1. nightcrawler234 macrumors newbie

    Joined:
    Jul 21, 2010
    #1
    Hi,

    I have been watching this tutorial:

    http://www.youtube.com/watch?v=LBnPfAtswgw


    I downloaded this sample code here:

    http://developer.apple.com/library/...on/Intro.html#//apple_ref/doc/uid/DTS40010160


    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:

    http://yfrog.com/cbscreenshot20100915at215p


    http://yfrog.com/mxscreenshot20100915at217p





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

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

    Joined:
    Jul 21, 2010
    #3
    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

    Joined:
    Jan 16, 2008
    Location:
    Nottingham, England
    #4
    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.

    http://www.arctus.co.uk/Tabby.jpg
     

Share This Page