-willTurnIntoFault or -didTurnIntoFault? I guess it's stupid to release properties in both of 开发者_开发技巧them, so I must choose one. Which is the best?
The object is not "gone" when turned into a fault. It is reduced to its smallest size (just an empty object with an -objectID
). If you are doing something in the -didTurnIntoFault
that causes a property to be touched you would reverse the fault which is bad.
If your clean up requires touching a property you should do it in the -willTurnIntoFault
. Otherwise it is pretty irrelevant which you choose.
The former is invoked just BEFORE the object is turned into a fault, the latter just AFTER. What kind of custom non-managed properties are you referring to? The choice may depend on this.
精彩评论