user1246165
user1246165

Reputation:

How to add my methods into UITableviewDelegate

is it possible to add my own methods in the UITableViewDelegate ? Please explain using some example if it is possible.

Thanks

Upvotes: 0

Views: 409

Answers (2)

mackworth
mackworth

Reputation: 5953

I think you mean "Is it possible to add my own methods in the UITableView delegate?" If so, yes, you can; I suggest you start with the UITableViewController template that Apple provides. Your methods can be added just by giving the header line followed by the code; that enables them being called from within your tableViewController. If you also want them callable from other objects, then also add the header line to the .h file, then import that header into objects that will call your tableViewController.

Upvotes: 0

Christian Schnorr
Christian Schnorr

Reputation: 10776

You could 'subclass' the UITableViewDelegate protocol, but you'd have to subclass UITableView, too, in order to call these methods at the desired times.

@protocol MyTableViewDelegate <UITableViewDelegate>
- (void)newMethod;
@end

Upvotes: 2

Related Questions