当前位置 博文首页 > xixi:自定义model 转出 字典

    xixi:自定义model 转出 字典

    作者:[db:作者] 时间:2021-08-07 15:33

    一般 都是 字典转出 Model? 但是Model 也能转出 字典

    unsigned int count;
        objc_property_t *properties = class_copyPropertyList([youModelClass class], &count);
        for(int i = 0; i < count; i++)
        {
            objc_property_t property = properties[i];
            
            NSLog(@"name:%s",property_getName(property));
            NSLog(@"attributes:%s",property_getAttributes(property));
            
            NSString *name = [NSString stringWithUTF8String:property_getName(property)];
            NSString *attributes = [NSString stringWithUTF8String:property_getAttributes(property)];
        }
        free(properties);
    


    cs
    下一篇:没有了