2012-01-17 6 views
-1

可能性の重複:
self.prop=nil; vs. [prop release];prop=nil;[foo release]とself.foo = nilの違い。

誰でも助けることができる、[foo release]self.foo = nil;の違いは何ですか?

+3

これは100万回もカバーされています。それは、プロパティ(キーワード)が合成される方法と全く関係しています。 –

+0

http://stackoverflow.com/questions/3702609/self-prop-nil-vs-prop-releaseprop-nil、http://stackoverflow.com/questions/4212628/whats-the-difference-between-setting-an -object-to-nil-vs-sending-it-a-release、http://stackoverflow.com/questions/6091394/is-setting-a-property-to-nil-same-as-releasing-the-property –

+0

前者はオブジェクトアドレスをfooで解放します。後者はfooへのポインタをnilに設定します。私はdealocルーチンでさえ、後者を好むようになった。 –

答えて

関連する問題