Creating a common selector class with UITableView or UIPicker

Posted by trevrosen on Stack Overflow See other posts from Stack Overflow or by trevrosen
Published on 2010-03-30T20:52:20Z Indexed on 2010/03/30 20:53 UTC
Read the original article Hit count: 587

Filed under:
|

I have several places in my app where I need to select a Foo for further processing from a list of Foo objects. I'd like to do this as a modal view, but neither UIPicker nor UITableView seems to lend itself to the standard approach, since the usual way to do a modal view controller involves setting the parent view controller up as the delegate, and both of those classes need to implement data source protocols, etc.

Implementing the data source and selection protocol methods in my parent view controller defeats the purpose of trying to use one common class for implementing this modal selector screen all over my app. Does anyone have any solutions to this problem or am I effectively stuck implementing this selector class over and over again?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk