Re: Using NSFetchRequest to fetch NSManagedObject subclasses
Re: Using NSFetchRequest to fetch NSManagedObject subclasses
- Subject: Re: Using NSFetchRequest to fetch NSManagedObject subclasses
- From: Matt James <email@hidden>
- Date: Sat, 10 Jul 2010 10:31:30 -0400
On Sat, Jul 10, 2010 at 3:35 AM, Roland King <email@hidden> wrote:
>
> On 10-Jul-2010, at 3:24 PM, Joanna Carter wrote:
>
> > Hi Matt
> >
> >> Wow, thank you so much. I have no idea how I missed the "Class" column
> in the xcdatamodel's UI. From what I saw, none of the tutorials mentioned
> doing this either. Maybe I was reading the newbie stuff where they didn't
> get into fun stuff like that.
> >
> > I'm not sure why you would need to put a different name into the Class
> column of the modeller. Common practice is to simply name the entities as
> you would have them be in code.
> >
> > e.g.
> >
> > Customer
> > [attributes]
> > name: String
> > address: String
> > …
>
> I guess because he wasn't autogenerating the code. If you just add an
> entity in the modeler and do nothing else, it gives it a default of
> NSManagedObject. That I think is where Matt was when he asked the question.
>
>
That's absolutely right, though I'm glad Joanna chimed in since I didn't
know that was the common way to generate those classes to begin with (as I
said, I'm completely new to the workings of Core Data).
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.
After receiving some errors from Xcode when generating the files, I began
wondering if this was the right decision. Does everyone usually stick these
files in the xcdatamodeld folder? (I wish I had the errors to show you, but
I didn't think to write them down when they popped up. Needless to say,
they were errors from Xcode, not during compiling.)
Thanks again for all the help, everyone!
-Matt
_______________________________________________
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