PDA

View Full Version : Single view w/UITabBar & UIPickerView




jrlepage
Aug 2, 2010, 09:06 PM
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.



robbieduncan
Aug 3, 2010, 01:57 AM
Well, first of all, you shouldn't be caring about C#. You need to learn Objective-C.

jrlepage
Aug 3, 2010, 10:35 AM
Well, first of all, you shouldn't be caring about C#. You need to learn Objective-C.

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?

dejo
Aug 3, 2010, 10:37 AM
Any thoughts on using a UITabBar to control which arrays are displayed in a double picker using a single view?
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.