Monday, December 9, 2013

Core Data Model Objects using Mogenerator


Download Mogenerator at http://rentzsch.github.io/mogenerator/

DownloadDownload mogenerator 1.27or install via homebrew:$ brew install mogeneratorupgrading using homebrew:$ brew update && brew upgrade mogenerator

Terminal
mogenerator --model CoreData/Model.xcdatamodeld/Model.xcdatamodel --output-dir Model/Mogenerator --template-var arc=true
XCode

1. Select your XCDataModeld
2. Editor --> Add Model Version

Projects --> Targets
Editor -->  Add Build Phases

MODELS_DIR="BeerBrowser/DataModel"
DATA_MODEL_PACKAGE="$MODELS_DIR/Beers.xcdatamodeld"
CURRENT_VERSION=`/usr/libexec/PlistBuddy "$DATA_MODEL_PACKAGE/.xccurrentversion" -c 'print _XCCurrentVersionName'`

mogenerator --template-var arc=true --model "$DATA_MODEL_PACKAGE/$CURRENT_VERSION" --output-dir "$MODELS_DIR/"


Or Simply,
/usr/local/bin/mogenerator --model "${PROJECT_DIR}/KhabarSanchar/CoreData/Model.xcdatamodeld/Model.xcdatamodel" --output-dir "${PROJECT_DIR}/Model/Mogenerator" --template-var arc=true

Sources




No comments:

Post a Comment