Skip to content

Commit

Permalink
NSObject+Reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakey committed Dec 22, 2015
1 parent d2e6e2b commit 3642420
Show file tree
Hide file tree
Showing 5 changed files with 619 additions and 202 deletions.
27 changes: 0 additions & 27 deletions Categories/Foundation/NSObject/NSObject+Property.h

This file was deleted.

169 changes: 0 additions & 169 deletions Categories/Foundation/NSObject/NSObject+Property.m

This file was deleted.

52 changes: 52 additions & 0 deletions Categories/Foundation/NSObject/NSObject+Reflection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// NSObject+Reflection.h
// NSObject-Reflection
//
// Created by Jakey on 15/12/22.
// Copyright © 2015年 Jakey. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSObject (Reflection)
//类名
- (NSString *)className;
+ (NSString *)className;
//父类名称
- (NSString *)superClassName;
+ (NSString *)superClassName;

//实例属性字典
-(NSDictionary *)propertyDictionary;

//属性名称列表
- (NSArray*)propertyKeys;
+ (NSArray *)propertyKeys;

//属性详细信息列表
- (NSArray *)propertiesInfo;
+ (NSArray *)propertiesInfo;

//格式化后的属性列表
+ (NSArray *)propertiesWithCodeFormat;

//方法列表
-(NSArray*)methodList;
+(NSArray*)methodList;

-(NSArray*)methodListInfo;

//创建并返回一个指向所有已注册类的指针列表
+ (NSArray *)registedClassList;
//实例变量
+ (NSArray *)instanceVariable;

//协议列表
-(NSDictionary *)protocolList;
+ (NSDictionary *)protocolList;


- (BOOL)hasPropertyForKey:(NSString*)key;
- (BOOL)hasIvarForKey:(NSString*)key;

@end
Loading

0 comments on commit 3642420

Please sign in to comment.