Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はよくNSNotificationをviewDidLoadに登録し、deallocに登録解除しました。iOS 5にはdeallocがありません。NSNotificationの登録を解除するにはどうすればよいですか?
ARCでもdeallocを使用できます(これはiOS 5の意味だと思います)-以前と同じようにメソッドを定義するだけです。[superdealloc]を呼び出さないでください。
- (void) dealloc { // unregister and clean up. // NO SUPER! }
私はこのパターンをよく使用します。特にリークをチェックするときは、NSLogをそこに配置すると便利です。