ModelCoder 可以通过 JSON 字符串自动生成 Objective-C 代码。
1.安装 Homebrew
如果已安装 homebrew
,请跳至第二步
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
2.安装 objc-run
如果已安装 objc-run
,请跳至第三步
brew install objc-run
找到 objc-run
路径并确保可执行位设置如下
chmod u+x objc-run
3.使用 curl 下载 main.m
如果已下载 main.m
,请跳至第四步
curl -O https://raw.githubusercontent.com/zhuchaowe/ModelCoder/master/main.m
4.运行!!!
objc-run main.m className savePath http://the.json.url.com
1.从 json url 读取
objc-run main.m Test /Users/easyios/Desktop/objc http://t.cn/RPjToNg
2.从 json 文件读取
objc-run main.m Test /Users/easyios/Desktop/objc /Users/easyios/Desktop/objc/EasyIOS.json