Reputation: 32986
In this part of my code I get a warning message saying it doesn't implement the custom protocol I made.
detailViewController.delegate = self;
How do I implement the protocol?
Then when I run the program it crashes saying
'-[DetailViewController setDelegate:]: unrecognized selector sent to instance 0x6a1c450'
Upvotes: 1
Views: 623
Reputation: 8448
Declare your class like this:
@interface DetailViewController : UIViewController <MyProtocol> {
// Class stuff
}
Upvotes: 1