objc_msgSend
来源:互联网 发布:常见办公软件 编辑:程序博客网 时间:2024/05/18 03:44
objc_msgSend调用实例方法,即使是所谓私有方法
// Dog.h#import <Foundation/Foundation.h>@interface Dog : NSObject@property(nonatomic, strong) NSString * dogName;@property(nonatomic, assign) NSInteger dogAge;@end
// Dog.m#import "Dog.h"@implementation Dog- (instancetype)init{ self = [super init]; if (self) { self.dogName = @"dahuang"; self.dogAge = 2; } return self;}- (void) printDogName{ NSLog(@"dogName");}@end
可以看到Dog类头文件中并没有printDogName方法的声明,所以Dog类的实例是不能访问到printDogName方法的,这就是所谓的私有方法,但并不是这个方法就不能再类外进行访问了,可以通过objc_msgSend
虽然有警告说没有定义printDogName方法,但通过objc_msgSend方法还是访问到了。
0 0
- objc_msgSend
- objc_msgsend crash
- objc_msgSend函数
- objc_msgSend () 错误
- objc_msgSend函数
- objc_msgSend crash
- runtime objc_msgSend
- 详解objc_msgSend
- runtime-objc_msgSend
- Objc_msgSend 方法
- objc_msgSend函数 iphone
- objc_msgSend (xcode)
- 深入分析 objc_msgSend
- objc_msgSend函数 iphone
- runtime-class_addMethod\objc_msgSend\NSInvocation
- 理解 objc_msgSend 的角色
- ios objc_msgSend函数
- 深入分析 objc_msgSend
- 减少存储过程封装业务逻辑-web开发与传统软件开发的思维模式不同
- 美团大众点评合并:背后技术力量的对比回顾
- No result defined for action org.album.web.PhotoAction and result input
- [cocos2dx]Android编译的一些注意事项
- YUV格式解析
- objc_msgSend
- 面向对象1
- 关于DLL搜索路径的顺序问题
- POJ2406 Power Strings
- 入门正则
- mysql 笔记 查询时分秒做条件
- 玩转Visual Studio-高效管理代码
- 【首届大数据社区研讨会】听技术大咖如何解读大数据
- android地址