views:

1035

answers:

2

I have a situation where I have to take input from the user using multiple views (like Personal Information -> Professional Information -> Process Completed).

I was wondering, how can I build a class like UIImagePickerController, which takes input from user and returns the data to parent class? Note that the view is also handled by this class.

+1  A: 

This is a perfect example of a delegate pattern.

You create the object, assign a delegate. The object allows user interaction. When the user closes the object view, the object tells the delegate "here's the chosen value."

This is a standard pattern in Cocoa & Objective-C and you should learn to use it, as you run across it very frequently (UITableView, for example, or UIImagePickerView both use the delegate pattern).

August
A: 

Thanks August. Do you have a sample example in mind? From Apple's Sample Code maybe or somewhere else - that can help?

Appreciated.

Mustafa