I have been using Core Data for a while now, several years at least. Over time, I have learned how it works internally and learned to side-step possible issues and shortcomings. The following is a unordered list of tidbits.
KVO is very, very dangerous. No matter how skillful you believe to be, strive to avoid it as much as you can.
If you really need KVO, then use Facebook’s KVOController. Don’t ever attempt to write the required code on your own. Just look at the source code of this Facebook’s bag of voodoo if you need reasons.
Don’t ever use KVO to monitor changes in Core Data objects.
One way to declare and assign the notification name is using global strings in .h file:
then assigning the values in the .m file:
However, long strings like this are hard to scan when reviewing the code. Thus I prefer to namespace them using structs.
(puttin’ the grumpy hat on, full Crusty mode)
Don’t use instance variables
Before properties, Objective-C code was usually like this:
1 2 3
and then followed by explicit getter and setter methods in implementation that read or set this
_internalVar. If you are still using this – stop. When I see code written like this, I dismiss it as obsolete and move on to something else.
@property. Always and ever.