views:

61

answers:

1

Hi

I am new to iphone development. I have to develop an iphone application which is basically a questionare. When user runs the application he has to answer around 30 questions, each one at a time. I am planning to use the Navigation template project for this application. Where i can create a view with question and optional answers (in table view) and when user selects an answer, i can push new instance of same view to navigational controller.

Is the the best practice for creating a questionare application. Or a better template exists? Is it advisable to store 30 instances of a view in view controller stack?

regards sandy

A: 

The navigation template is fine. However, I would do it in a slightly different way, mimicking a wizard.

Your initial root view controller should present the first question, when the user selects it, you push on the stack a new view controller in charge of handling the answer. When the user answer the question, you pop the view controller notifying your root view controller. You may do this using a protocol and a delegate or using a notification. Upon receiving the notification, or when the delegate method is called, the root view controller prepares the next question.

Repeat this cycle until the user answer the last question, then your root view controller presents to the user the final result.

unforgiven