Re: Core Data entity name issue
Re: Core Data entity name issue
- Subject: Re: Core Data entity name issue
- From: Quincey Morris <email@hidden>
- Date: Mon, 02 Jul 2012 19:49:27 -0700
On Jul 2, 2012, at 19:12 , Chuck Soper wrote: I think that I will adopt the following practice: before generating NSManagedObject subclass source files, add a prefix to the Entity class name by using the Data Model Entity inspector. When the NSManagedObject subclass source files are generated, the class and entity names will all be correct.
This practice should avoid these kind of compile and run time errors. I was surprised that it took a couple of weeks for the errors to show up.
FWIW, I'd suggest you start training yourself not to use common single words to name *anything* that you define. The danger of conflict is not worth any seeming saving of keystrokes. It also reduces the likelihood, if you get a run-time error about "time", of having to work out which of your classes that has a time is the one being referred to.
Incidentally, a while back I spent hours trying to understand a (KVC-related) run-time error message about an "invalid key name". OK, I asked myself, but *which* of the key names is invalid? Turned out it was referring to a key named "name". Naming a property "name" is about the worst naming choice I ever made. (Naming a property "value" comes in a close second, for similar reasons.)
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden