遍历控件属性

来源:互联网 发布:淘宝客服名称大全 编辑:程序博客网 时间:2024/06/06 04:16
        u_int count;        objc_property_t *properties =class_copyPropertyList([UIview class], &count);        NSMutableArray *propertiesArray = [NSMutableArray arrayWithCapacity:count];        for (int i = 0; i<count; i++)        {            const char* propertyName =property_getName(properties[i]);            NSLog(@"属性%@\n",[NSString stringWithUTF8String: propertyName]);            [propertiesArray addObject: [NSString stringWithUTF8String: propertyName]];        }