Re: Using NSFetchRequest to fetch NSManagedObject subclasses
Re: Using NSFetchRequest to fetch NSManagedObject subclasses
- Subject: Re: Using NSFetchRequest to fetch NSManagedObject subclasses
- From: Joanna Carter <email@hidden>
- Date: Sat, 10 Jul 2010 17:16:03 +0100
Hi Matt
> After using this technique, I did have one more question related to automated class generation. Xcode automatically tried to add the class files to the AppName.xcdatamodeld directory. My initial assumption was that this was only because I had it selected in the source list when I attempted to add the class files, so I selected a new destination of the Classes folder where all other classes are stored.
When you use the File|New File…|Managed Object Class route to create classes you get a dialog that asks you where to save the generated files. This usually defaults to saving the files, on disk, to the main project directory, but putting the files in the "virtual" Models folder in the project manager.
Personally, I tend to start every project by creating my own, preferred, folder hierarchy on disk, then changing the project manager folders to point to those folders.
Although you can, in theory, leave all the files, on disk, in the main project folder and simply work with project folders, which are only really logical groupings, I tend to use the following folder structure on disk (others may do it differently):
ProjectName
Models
Classes
Resources
English.lproj
French.lproj
…
I then move the files, generated when the project was created, to those directories, except for the ProjectName-Info.plist and ProjectName_Prefix.pch files, which I leave in the root directory.
This will cause the files and folders to turn a delicate shade of red :-) First of all, select the Models folder, press Cmd-I and change the path of the project folder to point to that on disk. Then do the same to the other folders and files until the project knows where to find everything.
Needless to say, there is more than one way to tackle this folder management and others may have their own opinions.
Joanna
--
Joanna Carter
Carter Consulting
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden