Single view w/UITabBar & UIPickerView

Discussion in 'iOS Programming' started by jrlepage, Aug 2, 2010.

  1. jrlepage macrumors 6502a

    Apr 22, 2010
    Southeast USA
    Hello all, I'm brand new to C# and Cocoa Touch, but have some C++ and VB experience from years back.

    I've started delving into the iPhone SDK and I'm having trouble with a simple project:

    I want to develop a basic app for unit conversion. I'd like it to have a single view with the following UI elements:

    NavBar w/done button to perform calculation
    Double Picker ("from" column and "to" column listing units)
    Tab Bar w/categories such as distance, mass, volume, etc. which when tapped will alter the arrays displayed in the picker view
    Text field to enter numerical value
    Label to display result

    Is it possible to do the above with a single view? From everything I'm reading, Tab Bars are intended to be used with multiple views... But in my case that seems unnecessary, since the only thing that would change between views is the contents of the pickers.

    If anyone could offer suggestions on what angle I should take structurally to tackle this project (i.e., a nudge in the right direction) I would greatly appreciate it.
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    Well, first of all, you shouldn't be caring about C#. You need to learn Objective-C.
  3. jrlepage thread starter macrumors 6502a

    Apr 22, 2010
    Southeast USA
    My mistake, Objective-C is what I've been reading up on. I guess I thought Objective-C was a subset of C#, or that the two were interchangeable. Thanks for the heads-up.

    Any thoughts on using a UITabBar to control which arrays are displayed in a double picker using a single view?
  4. dejo Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    It's certainly possible. It all comes down to the code you put in the delegate methods for reacting to the change of tab choice.

Share This Page