• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using NSFetchRequest to fetch NSManagedObject subclasses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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 08:24:13 +0100

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
  …

Invoice
  [attributes]
  date: Date
  …
  total: Decimal
  [relationships]
  customer: Customer
  lines: InvoiceLine

InvoiceLine
  [attributes]
  quantity: Integer16
  total: Decimal
  [relationships]
  product: Product

Product
  [attributes]
  code: String
  descriptive: String
  unitPrice: Decimal

The class for each entity will automatically be set to the same name as the entity. Then all you have to do is to select those entities in the designer and select File|New File… menu item to generate the Managed Object Classes for the entities.

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

  • Follow-Ups:
    • Re: Using NSFetchRequest to fetch NSManagedObject subclasses
      • From: Roland King <email@hidden>
References: 
 >Using NSFetchRequest to fetch NSManagedObject subclasses (From: Matt James <email@hidden>)
 >Re: Using NSFetchRequest to fetch NSManagedObject subclasses (From: Roland King <email@hidden>)
 >Re: Using NSFetchRequest to fetch NSManagedObject subclasses (From: Matt James <email@hidden>)

  • Prev by Date: Re: Using NSFetchRequest to fetch NSManagedObject subclasses
  • Next by Date: Re: Using NSFetchRequest to fetch NSManagedObject subclasses
  • Previous by thread: Re: Using NSFetchRequest to fetch NSManagedObject subclasses
  • Next by thread: Re: Using NSFetchRequest to fetch NSManagedObject subclasses
  • Index(es):
    • Date
    • Thread