non-mogenerator

Or how to make non-MO classes…

If you’re wondering what else you could use mogenerator to generate, how about following Dan Wood’s idea about using it to create non-MO classes? He has modified the template files to generate standard objects — as opposed to NSManagedObject subclasses — complete with instance variables, accessors, init and dealloc methods, and so on.

One thing to watch out for is to keep the various template files organized — they have the same names as the MO templates — so make sure you keep and use the right templates for MO or non-MO generation.

Dan was also good enough to suggest a couple of improvements to my previous instructions regarding getting the source for mogenerator:

1Checkout MiscMerge and mogenerator from https://svn.sourceforge.net/svnroot/redshed/. If you also want to build and run the mogeneratorTestMule project, checkout the CoreData+JRExtensions as well.

Viewing the repository

Okay, how exactly do you checkout the sources? Well, first let’s look at some of the URLs. In the original mogenerator post, Wolf had pointed towards the sources at http://svn.sourceforge.net/viewvc/redshed/trunk/cocoa/mogenerator/. If you follow that link you get a nice web interface, courtesy of ViewVC, which is a web-based version control repository browser. Essentially it allows you to look through the contents of the CVS or Subversion repository. Which is really nice, but there doesn’t appear to be a way to checkout files using it — perhaps not unsurprisingly, given the use of the term ‘View’ in its name.

So, if ViewVC isn’t going to help with checking out the code, where do we go next? Well, the repository is hosted on SourceForge, so the path to the repository itself can be obtained by removing the viewvc and replacing it with svnroot. Since I wanted to checkout a few things: mogenerator, miscmerge and CoreData+JRExtensions — and partly because I was nosey and wanted to see what other goodies where there — I chose to use the path to the repository’s root https://svn.sourceforge.net/svnroot/redshed/. Follow that link in a web browser and you'll get basic navigation, but none of the niceties of the ViewVC interface.

Checking the code out using svnX

So now we can view the repository in two different ways using a web browser, but we really want to check the code out. I tend to use svnX to manage access to different repositories, so:

Setting up repository in svnX.

svnx repository screenshot

1Open the Repositories window

2Click on the ‘+’ button

3Enter a suitable name, such as ‘Redshed’

4Enter the path, such as https://svn.sourceforge.net/svnroot/redshed

5Note that no username or password are required for this repository

6Double-click the Repository in the list to open it in a Repository window

7Navigate through the repository to root > trunk > cocoa > mogenerator

8Click svn checkout, and select a folder to put the checked out files in

9Repeat steps 7 and 8 for MiscMerge and CoreData+JRExtensions

If you get certificate errors when attempting to connect, follow the steps I wrote on subverting certificate warnings in svnX.

Checking the code out using svn checkout

Dan also pointed out that if you have the url to the repository you can use the svn checkout command to get the files directly. So, if you don’t want to use something like svnX, checkout the files from the command line:

1cd to the folder in which you want to place the checked out files

2Checkout the appropriate parts of the repository:

david$ svn checkout https://svn.sourceforge.net/svnroot/redshed/trunk/cocoa/mogenerator/
david$ svn checkout https://svn.sourceforge.net/svnroot/redshed/trunk/cocoa/MiscMerge/
david$ svn checkout https://svn.sourceforge.net/svnroot/redshed/trunk/cocoa/CoreData+JRExtensions/

3There is no step 3.

So there you have it — two different ways to view the repository in a web browser, and two different ways to checkout the files: visually using svnX, or from the command line.

Coming soon…

Hints at future integration between mogenerator and Xcode can be found in the repository in revision 207: "[NEW] Xmo'd: mogenerator + Xcode."

Post your own comment here:











Note: be friendly! We reserve the right to moderate inappropriate, offensive, or wildly off-topic comments. Your email address is required, but won't be displayed. All comments are moderated, so don’t expect them to show up instantly.