How to make tree control in IPHONE SDk

Discussion in 'iOS Programming' started by bhangale.parag, Sep 6, 2008.

  1. bhangale.parag macrumors newbie

    Joined:
    Sep 4, 2008
    #1
    hi all,
    i am new to the iphone sdk programming but i have to make tree control but which class is used for it i don't know so please help me.
    thanks in advance....
     
  2. Luke Redpath macrumors 6502a

    Joined:
    Nov 9, 2007
    Location:
    Colchester, UK
    #2
    There isn't a tree control in the iPhone SDK because it doesn't really fit with the iPhone UI/touch interface. You should look at UINavigationController and UITableView for presenting hierarchial data.
     
  3. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #3
    Luke is correct: there isn't a tree control as you probably shouldn't need one. If you absolutely, 100% definitely need one and can't use the provided controls as per the iPhone HIG then you need to create one from scratch. You will need to subclass UIView, do all your own drawing, event handling, animation, define your own datasource protocol etc. Lots and lots of work...
     
  4. keehun macrumors regular

    Joined:
    Mar 17, 2008
    #4
    Yes... if you need a tree view... Perhaps you need to rethink your application design. A nav controller + tableview should work with almost every design situation
     
  5. bhangale.parag thread starter macrumors newbie

    Joined:
    Sep 4, 2008
    #5
    Thanks

    Thanks to all of you,for giving me such a nice reply i will try to make that but
    you said earlier that with this UINavigationController and UITableView can i set the view as like as tree control? if there is any property of these classes that i set the view as like as tree control?
     
  6. admanimal macrumors 68040

    Joined:
    Apr 22, 2005
    #6
    Look at any of Apple's example programs that use a table view. Practically all of them mimic the same functionality that you would get from a tree view.
     
  7. chhoda macrumors 6502

    Joined:
    Oct 25, 2008
    #7
    similar

    Hi all,
    I need to do something similar

    On launch, the application presents the user with a grid of icons, similar to the default application style icons except larger. There should be 3 icons across on a portrait mode phone.
    Each icon either represents a group of further icons below, OR expands to an image image when pressed.

    further icons below should create a row in between and show the expanded icons (probably left indented a bit). anybody has come across a similar structure in any example which can help me cickstart this ? If there is no grouping i can do simple table display, this group expand has me little confusing

    --CH
     

Share This Page