写一个完整的代理
//创建
@protocol MyDelegate
@required
-(void)testOne:(Person*)person;
@optional
-(void)testTwo;
@end
//声明
@interface person: NSObject <Mydelegate>
//实现
@implementation person
-(void)testOne:(Person*)person{
NSLog (@"person");
}
-(void)run{
NSLog (@"run");
}
网友评论