Giter VIP home page Giter VIP logo

hkjsonkitex's Introduction

##可以简化json对应的对象的赋值操作,例如json数据对应 User 对象,只要json中key与 User 对象的property对应就可以赋值 ##目前支持类型为 NSString NSInteger double float BOOL NSNumber long long 等数字类型,支持自定义对象类型 NSArray 需要定义好集合中的对象类型 example:

     HKJSONEx* ex = [[HKJSONEx alloc] init];//初始化
 
     //添加参数cls类中 集合属性foodcats中元素的类型为参数addTypeToken
     [ex property:@"foodcats" cls:[HKRestaurantMenu class] addTypeToken:[HKFoodCat class]];
 
     [ex property:@"foods" cls:[HKRestaurantMenu class] addTypeToken:[HKFood class]];
 
     [ex property:@"prices" cls:[HKFood class] addTypeToken:[HKFoodPrice class]];
 
     [ex property:@"food_ids" cls:[HKFoodCat class] addTypeToken:[NSNumber class]];
     
     HKRestaurantMenu* menu = [ex objectForClass:[HKRestaurantMenu class] values:[dic valueForKey:@"menu"]];
     
     HKRestaurant* info = [ex objectForClass:[HKRestaurant class] values:[dic valueForKey:@"info"]];

hkjsonkitex's People

Contributors

akwei avatar

Watchers

James Cloos avatar Zike Xiong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.