How to extract delegates from ViewController class?

Posted by adranle on Stack Overflow See other posts from Stack Overflow or by adranle
Published on 2010-03-16T14:03:10Z Indexed on 2010/03/16 14:06 UTC
Read the original article Hit count: 277

Hi

I have the problem that my view controller class has too many delegates and starts to get big. I want to write the delegates in separate classes to keep the view controller class small. For delegates that are programmatically created (like UIAlertViewDelegate) I could do it easily. The problem is in the delegates assigned in Interface Builder. How can I tell the IB to assign, for example, another class as the UITableViewDelegate or UITableViewDataSource? Or how to choose another IBAction method for a Touch UP inside Event on a button? One solution would be to delete the connections from IB and write them programmatically at ViewDidLoad, but since I have a lot of ViewControllers, this would take a long time.

any other ideas?

© Stack Overflow or respective owner

Related posts about iphone-development

Related posts about interface-builder