How to make tree control in IPHONE SDk

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

  1. bhangale.parag macrumors newbie

    Sep 4, 2008
    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

    Nov 9, 2007
    Colchester, UK
    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


    Jul 24, 2002
    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

    Mar 17, 2008
    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

    Sep 4, 2008

    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

    Apr 22, 2005
    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

    Oct 25, 2008

    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


Share This Page