I have two entities: Folder <-->> Document, a开发者_运维问答nd Folder defines a To-Many relationship to Document with a cascade delete rule. My question is: is there some way for document object itself to detect when it is cascade deleted ?
Your Document should receive a -[NSManagedObject validateForDelete:]
message. You can also check whether an NSManagedObject
is deleted (or scheduled for deletion) with -[NSManagedObject isDeleted]
. So your Document's methods can perform the check on [self isDeleted]
.
精彩评论