Runtime
来源:互联网 发布:淘宝卖家自动核对地址 编辑:程序博客网 时间:2024/04/30 19:14
// 获取属性列表
// unsigned int count;
// objc_property_t *propertyList = class_copyPropertyList([self class], &count);
// for (unsigned int i =0 ; i< count; i++) {
// const char * propertyNmae = property_getName(propertyList[i]);
//
// NSLog(@"%s",propertyNmae);
// }
//获取方法列表
// Method *methodList = class_copyMethodList([self class], &count);
//
// for (unsigned int i = 0; i<count; i++) {
// Method method = methodList[i];
// NSLog(@"%@",NSStringFromSelector(method_getName(method)));
// }
// 获取成员变量
// Ivar *Ivarlist = class_copyIvarList([self class], &count);
// for ( unsigned int i = 0; i<count; i++) {
// Ivar myvar = Ivarlist[i];
// const char * var = ivar_getName(myvar);
// NSLog(@"%s",ivar_getName(myvar));
// }
// 获取协议列表
// __unsafe_unretained Protocol * *protocolList = class_copyProtocolList([self class], &count);
// for (unsigned int i = 0; i<count; i++) {
// Protocol *protocol = protocolList[i];
// NSLog(@"%s",protocol_getName(protocol));
// }
otocol_getName(protocol));
关联
// UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"收拾" message:@"s" delegate:self cancelButtonTitle:@"sure" otherButtonTitles:@"cancel", nil];
// objc_setAssociatedObject(alert, &ex,
// @"我是被挂载的",
// OBJC_ASSOCIATION_RETAIN_NONATOMIC);
// [alert show];
//- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
//{
// if (buttonIndex == 1) {
// NSLog(@"%@", objc_getAssociatedObject(alertView, &ex));
// }
//}
- runtime
- Runtime
- Runtime
- Runtime
- runtime
- runtime
- Runtime
- runtime*****
- runtime
- runtime
- runtime
- runtime
- runtime
- Runtime
- runtime
- runtime
- runtime
- runtime
- Android开发中常见的设计模式
- DB2设置时间类型字段默认为当前时间
- 小胖说swift02--------Swift如何使用Masonry和SnapKit
- JS刷新页面总和!多种JS刷新页面代码!
- Android Application对象必须掌握的七点
- Runtime
- 数据查询网站
- IPC机制--使用ContentProvider
- 数据结构实验之栈六:下一较大值(二)
- jeeCmsV7-src 源码解析之三(ehcache-hibernate.xml)
- linux--vi命令大全
- fiddler抓https的包
- LeetCode | Best Time to Buy and Sell Stock III
- c++中replace函数用法总结