开发者

How to detect object is cascade deleted by coredata

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].

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜