开发者

How to implement a custom protocol

开发者 https://www.devze.com 2023-01-19 04:19 出处:网络
In this part of my code I get开发者_高级运维 a warning message saying it doesn\'t implement the custom protocol I made.

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'


Declare your class like this:

@interface DetailViewController : UIViewController <MyProtocol> {
    // Class stuff
}
0

精彩评论

暂无评论...
验证码 换一张
取 消