如何使用protocol
来源:互联网 发布:java log4j 视频教程 编辑:程序博客网 时间:2024/05/14 12:03
1。 声明
@protocol CommuHistoryDelegate <NSObject>
-(void)change;
@end
2. 实现协议,说白了就是实现接口
@interface InterRuleControl : UIViewController<CommuHistoryDelegate>
-(void)change
{
NSLog(@"********** delegate implement");
self.flashMode = InterRuleControlFlashReload;
}
3. 设置协议指针
id<CommuHistoryDelegate> myDelegate;
4. 通知
if([ myDelegate respondsToSelector:@selector(change)])
{
[myDelegate performSelector:@selector(change)];
}
转载时记得回复下。
- 如何使用protocol
- @protocol和category中如何使用@property?
- 【python】如何在python中使用protocol buffer
- @protocol和category 中如何使用@property (协议和分类中如何使用@property属性)
- @protocol和category 中如何使用@property (协议和分类中如何使用@property属性)
- protocol使用举例
- Category Protocol 使用场合
- protocol buffer简单使用
- Category Protocol 使用场合
- Protocol Buffers使用入门
- 协议的使用 Protocol
- Java 使用 Protocol Buffers
- Protocol Buffers 使用
- IOS protocol 的使用
- Protocol buffer使用
- protocol buffer使用举例
- IOS开发protocol使用
- Protocol Buffer使用
- 在web.xml中引入其他xml文件
- 智能客户端的定义
- 再谈 eBay 的扩展性最佳实践
- 关于导出任意文件类型
- When I use the Report Viewer ,I have the error,how should i do?
- 如何使用protocol
- ArcGIS9.2安装步骤
- 转贴 c# 操作excel 补充
- Asp.net 2.0 关于Header/title/Meta tages/Style操作的一点小技巧
- 什么叫网表?
- Smart Client有多Smart
- svn碰到“Cannot accept non-LF line endings in 'svn:log' property”而无法提交时
- QoS&Diffserv
- 100+ jquery插件应用,让你的Web开发事半功倍_前端设计