Multiple choics iPhone App - UITableView? - iphone

I am developing a voting app, where the User will be presented with a question and multiple choices. In a typical HTML world the choice for this interface would be a Radio Box/Check box. What kind of view would I use in the iPhone SDK for a similar behavior?
Are there any sample apps which I can refer to?
Thanks,
Amy

Any time you're displaying repeating rows of data, UITableView is the natural choice. UITableViewCell provides various properties for you to customize the selected state which you can use to show the user's selected choice.

If your question has a few answer (3-4), then you can use an UIActionSheet. This is much quicker to code and provides a good looking user interface, with the sheet animating from then bottom of the iPhone and presenting to your user multiple button related to the possible choices/answers. It's a radio interface, in the iPhone Style.
Another possibility is to exploit an UISegmented control, a different type of radio interface.
If there are many answers, an UITableView is your best choice.

Related

Create an iPhone app with more than one "screen"

I am relatively new to Objective-C / iPhone programming, and have only created single view applications thusfar. I am interested in creating an app soon than will have a "wireframe" in a sense that allows me navigate the various views of my app using buttons. So I guess my questions are:
What do I need to do to make an app that has more than one view
How to I link them with UIActions in buttons to navigate the various screens (ex a back button to go to a previous screen)
and I may have more as I go, but this is a start.
Thanks!
Since no one really had a clear helpful answer, I will share my own conclusion. Xcode 4 offers a very intuitive and interactive way to create multiple MVCs and segue between them even providing the interface to travel between views. I found out how to use this feature from Paul Haggarty's iOS course on iTunes U. I highly recommend it.
Joey
You'd can use a combination of, multiple UIViewController and or UINavigationController's. Utilizing methods such as presentModalViewController:animated: and pushViewController:.

Why did Apple not include radio buttons in Interface Builder?

I realized that people have been implementing their own UIButton derivates to create radio buttons on iPhone, as this blog post shows.
This question's accepted answer states you can use Picker Views or Grouped Table views with a check mark, but it seems like a poor man's solution to me. Hence, my question: what is Apple's likely reasoning?
Are radio buttons a bad UI solution for touch interfaces?
Is it so rarely used that it's not worth cluttering IB with?
Another reason I don't quite see, maybe? I believe it's important to find this out, because if Apple thinks radio buttons suck, I'd rather not use them, and rethink my interface whenever I "believe" I should use one...
Radio buttons are a bad UI solution if they are poorly implemented. i.e. too small to reliably work with touches - which is why it's usually better to either use a toolbar or segmented control of options or a tableview of options.
Actually seeing it with a different angle, Apple has neither provided Radio buttons or even Check Box and maybe not because they think that it is a bad UI solution. But instead they've empowered the UIButton control very much that we can configure it as a Radio button or a check box or a switch or anything else with few lines of code.
A UIButton object can be configured and designed in various ways. We've seen various apps using the UIButton very creatively. I personally like the versatility of UIButton rather than Apple directly providing the radio button and Check box to drag and drop it in the interface.

Changing views iphone

this is a very noobie question although I have had quite a bit of experience iphone development.
I have a client who wants an app with various screnns, but does not want to use built in iphone navigation, but instead wants to have buttons on the screens. All I can find is a load of 14 year olds giving tutorials on MVC or using different views in the same nib.
Does anybody know what apples suggested way of doing this is as I can imagine it been a mind field.
Many thanks
Maybe you should have followed the MVC tutorials of the 14 year old guys.
Then you would know that you could use the built in iphone navigation controllers (ie UITabBarController, UINavigationController) without their standard view counterparts (ie UITabBar, UINavigationBar).
You could always just draw buttons on the screen in interface builder and use custom images for the normal/highlighted states.
When the button is pressed it's up to you what you'd like to do with the received buttonclick method being invoked... the usual way is with the standard navigation system which can optionally have a navigation bar at the top with (back) button, title, etc... and you push/pop viewcontrollers in a hierarchical way. You can just turn the title (or change for your own style) but it does enforce a hierarchical structure.
If you don't want hierarchical navigation of your screens you can either do this with your own custom navigation controller than handles which viewcontroller is currently visible or you could use a thirdparty component like three60 which allows you to navigate around like a webbrowser does on webpages.
You may also want to take a look at Corona which is more for games but would allow you to do a totally custom interface with all sorts of custom transitions and just needs you to write lua... that said it will limit you on using their engine with this approach as you can't get to the ObjC level.
Finally one last approach is simply to use webview and pick up the clicked links so you design your app via webpages... rather ugly approach but can work well if you're very familiar with HTML.

iphone custom datepicker

Is there any datepicker UI elements that I can use on my iphone application? Native one is found to be too big.
Maybe the right question is why is it too big? Apple has done a pretty good job of making a set of controls that apply for most circumstances, look stylish, and are usable by the user.
The default control is the size of the iPhone keyboard, and it was made this way for a very good reason: all elements are easily viewable and selectable by touch. If you have a lot of UI elements making life difficult, consider displaying the selected date/time in a label and edit it in a modal dialog.

Questions about recreating the "Add Alarm" form in the iOS Clock app

(source: kominetz.com)
Hello. I'm diving into iOS development and am building my own alarm app to become familiar with the SDK. My questions are...
I've played around with UITableViews a bit, but I don't understand how I would implement the table at the top half of this form. If I had to guess, I would say it's a single UITableView, defined with one section and four rows, is that right?
If so, to implement it, would I just "hardcode" the cellForRowAtIndexPath function to create each cell manually?
If not, is there an adopted approach to defining the layout and functionality of these types of settings pages?
Row #3 has a switch in it, is this a predefined cell style or a custom cell style that I have to define myself?
Rows #1, 2, and 4 take the user to new views when they're touched. Is this a predefined style and or do I just implement the standard didSelectRowAtIndexPath functionality to push a new view onto the stack?
Thanks so much in advance for your help! I'm going to continue researching these questions right now.
In answer to your questions:
Yes
Yes
n/a
No, you have to add a UISwitch to the cell's contentView. Tip: Look at Apple's UICatalog sample code (controls sections) to see how to implement a tableview with different controls in different rows.
Just use didSelectRow...
For most apps, you want to implement the Application Preferences settings plist that will be used by the device's Settings application. It's typically a good idea to keep the settings for your app consistent with how the settings work in other apps.