利用forwardInvocation和First Responder在xcode联接未定义的Action
来源:互联网 发布:三洋air9s性能数据 编辑:程序博客网 时间:2024/05/18 01:47
因为要在多个类的对象中调用相同的方法名,因此在一个通用类中重载了forwardInvocation方法。
- (void)forwardInvocation:(NSInvocation *)anInvocation
{
id controller = [tabViewItemmyController];
SEL aSelector = [anInvocationselector];
[controllerperformSelector:aSelector];
}
但是在给控件联接First Responder联接selector时,却连接不上,之前的代码虽连接上了,只是显示了一个叹号,提示未定义的Selecor. 但程序的运行是不存在任何问题的,也能正确地响应selector,
处理方法,在任意处增加一个mycation:(id)sender函数,然后控件的@selector联接到First Responder的my cation,然后再删除myaction方法,因为个在forwardInvocation中会调用到各数类的my action方法。
0 0
- 利用forwardInvocation和First Responder在xcode联接未定义的Action
- first responder
- first responder与小键盘之间的关系
- 关于IB中的File's Owner和First Responder
- iphone的responder chain及interface builder中First Responder的使用方法
- 关于File's Owner, First Responder, Application Delegate的解释
- 对xib/nib, file's owner, first responder的理解
- 对xib/nib, file's owner, first responder的理解
- 对xib/nib, file's owner, first responder的理解
- 对xib/nib, file's owner, first responder的理解
- 对xib/nib, file's owner, first responder的理解
- xib 种的file's owner&& First Responder
- performSelector和forwardInvocation之消息的派发和转发
- 理解xib(nib)、File’s Owner、First Responder、outlet、action等概念
- 理解xib(nib)、File’s Owner、First Responder、outlet、action等概念
- 理解xib(nib)、File’s Owner、First Responder、outlet、action等概念
- forwardInvocation
- 不用私有API,一行代码获取当前响应链的First Responder
- Mysql设计时该不该加约束
- Monitor类:Object synchronization method was called from an unsynchronized block of code.
- 解决了为什么按了Tab键为什么不会出现html:5的格式
- 修改feedback接收邮件的邮箱
- zoj 2921 Stock(贪心)
- 利用forwardInvocation和First Responder在xcode联接未定义的Action
- 欲为Java技术大牛所需的25个学习要点
- 2.2 Bind系统调用
- GetMemory函数详解
- 杭州推首个网购规章:卖家买家都可能吃罚单
- 查看静态库文件支持的指令集架构的方法
- 自助建站系统哪个好点
- poj3468 线段树懒惰标记
- Android应用内存管理