#import<objc/runtime.h>unsignedint count;
Ivar *ivarList =class_copyIvarList([UITextField class],&count);for(int i=0; i< count; i++){
Ivar ivar = ivarList[i];NSLog(@"%s",ivar_getName(ivar));}free(ivarList);
OC获取UITextField的成员变量的方法#import <objc/runtime.h> unsigned int count; Ivar *ivarList = class_copyIvarList([UITextField class], &count); for (int i=0; i< count; i++) { Ivar ivar = ivarList[i]; NSLog(@"%s",ivar_getName(ivar)