Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

1.27 asserts on -[MOGeneratorApp setModel:] (current rev is OK) #169

Open
fritza opened this Issue · 15 comments
@fritza

The latest public release (1.27) asserts in -[MOGeneratorApp setModel:] for a stupid-simple xcdatamodeld. This is fixed in the latest revision, (e8a05a316), but I have to explain mogenerator to a readership that can't be trusted to clone a Git repo.

Supplying the .xcdatamodel inside the .xcdatamodeld cures the problem in 1.27.

The notes for 1.27 advertise the handling of .xcdatamodeld as an enhancement in that release.

Can a 1.28 possibly be packaged-up in the next few weeks?

Always recognizing I may be doing something boneheaded.

Sample project in Dropbox.

$ mogenerator -v
mogenerator 1.27. By Jonathan 'Wolf' Rentzsch + friends.

$ pwd
/Users/fritza/Desktop/KillMeMogenerator/KillMeMogenerator

$ ls
Base.lproj          KillMeMogenerator-Info.plist
Images.xcassets         KillMeMogenerator-Prefix.pch
KMGAppDelegate.h        Model.xcdatamodeld
KMGAppDelegate.m        en.lproj
KMGViewController.h     main.m
KMGViewController.m

$ mogenerator --model Model.xcdatamodeld/
Assertion failed: (model), function -[MOGeneratorApp setModel:], file /Users/wolf/code/github/mogenerator/mogenerator.m, line 681.
Abort trap: 6

$ mogenerator --model Model.xcdatamodeld/Model.xcdatamodel/
4 machine files and 4 human files generated.

$ 
@mpillsbury

I ran into this too, but I was able to work around it.

  1. Create a new data model version and set it to be the "current" model.
  2. Run mogenerator. For whatever reason, mogenerator succeeds with the model in this state.
  3. Follow these instructions to remove the original (superfluous) model version.
  4. Now mogenerator runs fine.
@marklarr

@mpillsbury :+1:, this is a pretty big issue for new users.

@nbrew

@mpillsbury Thanks for the workaround. I was just trying mogenerator for the first time this afternoon and your instructions help me actually generate my models.

@2bj

@mpillsbury thanks, :+1:

@siuying

@mpillsbury it worked!

@dglancy

for this workaround. 9 months later :+1:

@link82

Worked!! Thank you :+1:

@cliftonlabrum

Hey @mpillsbury can you explain how to set the "current" model in Xcode? I'm not seeing anywhere to do that.

@marklarr

When you have your xcdatamodel selected in Xcode, make sure that you have the right-pane enabled. You'll see it over there.

@cliftonlabrum

That's bizarre... I don't have that section: http://d.pr/i/UwUt

@marklarr

... I'm stumped :confused:

@siuying

@cliftonlabrum if you have not added new versions to your model, the "Model Version" will not show. You can add version in "Editor" menu.

screen shot 2014-08-22 at 4 51 05 pm

@cliftonlabrum

Thanks, everyone. I created a new model version, set it to be the current one, then attempted to build Mogenerator again in Xcode, and it still fails with this error:

Assertion failed: (model), function -[MOGeneratorApp setModel:], file /Users/wolf/code/github/mogenerator/mogenerator.m, line 681.

/Users/Clifton/Library/Developer/Xcode/DerivedData/PilotPro-filxyzjonkycoudxopysgsddcbuj/Build/Intermediates/PilotPro.build/Debug-iphonesimulator/Mogenerator.build/Script-AF1A110719A6F4A4004E3BF7.sh: line 2: 59537 Abort trap: 6           mogenerator -m /Users/Clifton/Mobile/PilotPro/Global/Core\ Data/Tempy.xcdatamodeld -O /Users/Clifton/Mobile/PilotPro/Global/Models --template-var arc=true
Command /bin/sh failed with exit code 134

I assume I'm building it right by selecting Mogenerator to be the target and hitting Command+B
mogen

@Mazyod

@cliftonlabrum in my case, making a change like this fixes the issue:

FROM: /Users/Clifton/Mobile/PilotPro/Global/Core\ Data/Tempy.xcdatamodeld 
TO: /Users/Clifton/Mobile/PilotPro/Global/Core\ Data/Tempy.xcdatamodeld/Tempy.xcdatamodel

As one of the users above suggested.

@iSevenDays

@mpillsbury you saved my time! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.