UITableView programatically create delegate object?

Posted by fuzzygoat on Stack Overflow See other posts from Stack Overflow or by fuzzygoat
Published on 2010-05-10T16:31:38Z Indexed on 2010/05/10 16:34 UTC
Read the original article Hit count: 494

Filed under:
|
|

I have a question regarding setting up a custom delegate class for use with UITableView. What I have done is as follows:

  • Setup a new class (in sperate *.h and *.m files for the class)
  • Conformed that new class to the <UITableViewDelegate, UITableViewDataSource> protocols
  • Added the required methods.
  • Created a pointer to the new object using @property and IBOutlet.
  • In InterfaceBuilder created and assigned an object template to my new class
  • Assigned the dataSource and delegate connections.

This all works fine. My question is if I don't want to use interfaceBuilder to setup and instantiate my new delegate class directly in Xcode how do I go about doing that? More specifically how would I:

  • Instantiate the delegate class, would that be created / owned by the controller?
  • Set the dataSource and delegate connections?
  • What is the best way of doing this?

any help / information is much appreciated.

Gary

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa-touch