开发者

Which one should I prefer for releasing my custom non-managed properties?

开发者 https://www.devze.com 2023-01-02 19:32 出处:网络
-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

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

0

精彩评论

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