My Core Data managed objects (instances) all have their own index.
Naturally, when I add an object, I want to set its index to the
highest index value so far, + 1. This should be done in -
awakeFromInsert.
However, when I perform a fetch request from there, a second (new)
item appears in the table (instead of just one). This can't be right.
See the section "Methods to Override Considerations". -
initWithEntity:insertIntoManagedObjectContext: is listed as a method
which cannot have side effects on the context; you cannot fetch or
save from it. -awakeFromInsert is called from in that same call stack,
so fetching from awakeFromInsert is probably also not allowed.
I've filed a bug asking for doc clarification.
Jim
_______________________________________________
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