NSInvocation 回调使用
来源:互联网 发布:旋转矩阵计算器 编辑:程序博客网 时间:2024/06/05 09:40
声明
赋值
开始回调
使用
NSInvocation* m_touchDown;
赋值
-(void) setTouchMoveCallback:(id) target sel:(SEL) sel { if (m_touchMove) { [m_touchMove release]; m_touchMove = nil; } NSMethodSignature *sig= [target methodSignatureForSelector:sel]; NSAssert(sig, @""); m_touchMove = [NSInvocation invocationWithMethodSignature:sig]; [m_touchMove setTarget:target]; [m_touchMove setSelector:sel]; [m_touchMove setArgument:&self atIndex:2]; [m_touchMove retain];}
开始回调
- (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{ if (m_touchDown) { [m_touchDown setArgument:&touch atIndex:3]; [m_touchDown setArgument:&event atIndex:4]; [m_touchDown invoke]; } return YES;}
使用
[btn setTouchDownCallback:self sel:@selector(eventTouchBegin:touch:event:)];
回调函数
-(void) eventTouchBegin:(myButton*) sender touch:(UITouch*) touch event:(UIEvent*) event { // TODO}
- NSInvocation 回调使用
- NSInvocation使用
- NSInvocation使用
- NSInvocation简单使用
- NSInvocation简单使用
- [iOS] NSInvocation简单使用
- NSInvocation简单使用
- NSInvocation简单使用
- NSInvocation简单使用
- NSInvocation简单使用
- NSInvocation简单使用
- NSInvocation的使用
- NSInvocation的使用
- NSInvocation使用示例
- NSInvocation简单使用
- NSInvocation简单使用
- NSInvocation的使用
- NSInvocation的使用
- erlang连接到mysql
- Struts通过加载插件的形式初始化系统常量以及其他信息
- 获取android应用程序信息(PackageInfo、ActivityInfo、ResolveInfo)
- 第十一篇 BCD码调整
- erlang 内存被大量占用,跟踪过程
- NSInvocation 回调使用
- linux times函数分析。
- java.lang.IllegalArgumentException: node to traverse cannot be null!
- PHP上传文件功能实现
- 基带芯片、射频芯片相关
- tomcat document
- linux内核学习1 start_kernel()
- 分治算法三(随机化快速排序)
- Rolling Hash(Rabin-Karp 算法)匹配字符串与anagram串