GithubHelp home page GithubHelp logo

mjextension's Introduction

MJExtension

Conversion between JSON and model

一、MJ友情提醒

  • MJExtension是一套“字典和模型之间互相转换”的轻量级框架
  • MJExtension能完成的功能
  • 字典(JSON) --> 模型(model)
  • 模型(model) --> 字典(JSON)
  • 字典数组(JSON array) --> 模型数组(model array)
  • 模型数组(model array) --> 字典数组(JSON array)
  • 具体用法主要参考 main.m中各个函数 以及 "NSObject+MJKeyValue.h"
  • 希望各位大神能用得爽

二、部分API用法

  • 将字典的键值对转成模型属性

    • (void)setKeyValues:(NSDictionary *)keyValues;
  • 将模型转成字典

    • (NSDictionary *)keyValues;
  • 通过模型数组来创建一个字典数组

    • (NSArray *)keyValuesArrayWithObjectArray:(NSArray *)objectArray;
  • 通过字典来创建一个模型

    • (instancetype)objectWithKeyValues:(NSDictionary *)keyValues;
  • 通过plist来创建一个模型(仅限于mainBundle中的文件)

    • (instancetype)objectWithFilename:(NSString *)filename;
  • 通过plist来创建一个模型

    • (instancetype)objectWithFile:(NSString *)file;
  • 通过字典数组来创建一个模型数组

    • (NSArray *)objectArrayWithKeyValuesArray:(NSArray *)keyValuesArray;
  • 通过plist来创建一个模型数组

    • (NSArray *)objectArrayWithFilename:(NSString *)filename;
  • 通过plist来创建一个模型数组

    • (NSArray *)objectArrayWithFile:(NSString *)file;

mjextension's People

Contributors

codermjlee avatar

Watchers

James Cloos avatar daniel.huang 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.