• 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: Core Data - use of simple accessors vs. KVC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data - use of simple accessors vs. KVC


  • Subject: Re: Core Data - use of simple accessors vs. KVC
  • From: Negm-Awad Amin <email@hidden>
  • Date: Thu, 28 Aug 2008 08:09:40 +0200


Am Mi,27.08.2008 um 19:57 schrieb mmalc crawford:


On Aug 27, 2008, at 10:36 AM, Negm-Awad Amin wrote:


Am Mi,27.08.2008 um 19:19 schrieb mmalc crawford:


On Aug 27, 2008, at 9:48 AM, Negm-Awad Amin wrote:
Am Mi,27.08.2008 um 18:22 schrieb Oleg Krupnov:
Suppose I have a Core Data model object MyObject with property myProp
defined in the model editor's schema.
Can I use the simple accessors like this:
[myObj myProp]
[myObj setMyProp]
or am I forced to use the rather clunky valueForKey/ setVakyeForKey messages?

<http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdUsingMOs.html >
Managed objects automatically fake accessors for entities.

No, they don't fake accessors for entities, they dynamically generates accessor methods for managed object classes.
I call this fake.

"Fake" is not terminology that is used in this context, and it's at best misleading.
It did not mislead him.

The system dynamically generates accessor methods, that's it.



You can subclass NSManagedObject and add properties using @property and @dynamic, which means, that the accessors will be generated dynamically at run-time. (Without @dynamic you will get a compiler warning: incomplete implementation blablabla)

There is no need to create a subclass,
"You *can* subclass NSManagedObject …"
you can use a category instead.
There is no need to create a category. You can use a subclass instead.

It's not clear what your point is.
I said that you *CANÜ* do it this way. Anyway it is the recommended

There is no need to create a custom class if all you're doing is declaring accessor methods. Your reply did not state that.
Oh, I see. Sorry. I thought, that "can" refers to a possibility. I did not know, that it refers to a need. I thought, that I have to use words like "have to", "must" to describe a need.

Sorry for that



There is documentation about @property and Core-Data esp. in relation to retain/copy/assign. (The quintessence: Use retain!)

You may also consider 'copy' if appropriate
"There is documentation about @property and Core-Data esp. in relation to retain/copy/assign. (The quintessence: Use retain!)"

You gave no pointer to the actual documentation.
A mentioned the documentation. I did not link it. The TS was able to find the documentation.

Beside this, it said "quintessence". Since the documentation recommend using -retain and this hint is in italics, I think, that this is the quintessence.

It is important to also consider the use of 'copy' since it is important in some cases.
"There is documentation about @property and Core-Data esp. in relation to retain/copy/assign. (The quintessence: Use



mmalc

_______________________________________________

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

Amin Negm-Awad email@hidden




_______________________________________________

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


References: 
 >Core Data - use of simple accessors vs. KVC (From: "Oleg Krupnov" <email@hidden>)
 >Re: Core Data - use of simple accessors vs. KVC (From: Negm-Awad Amin <email@hidden>)
 >Re: Core Data - use of simple accessors vs. KVC (From: mmalc crawford <email@hidden>)
 >Re: Core Data - use of simple accessors vs. KVC (From: Negm-Awad Amin <email@hidden>)
 >Re: Core Data - use of simple accessors vs. KVC (From: mmalc crawford <email@hidden>)

  • Prev by Date: Re: Bindings and empty text field nil assigments
  • Next by Date: Re: NSFileManager Help
  • Previous by thread: Re: Core Data - use of simple accessors vs. KVC
  • Next by thread: Re: Core Data - use of simple accessors vs. KVC
  • Index(es):
    • Date
    • Thread