「NSObject Protocol Reference」の編集履歴(バックアップ)一覧に戻る
NSObject Protocol Reference - (2010/01/27 (水) 21:30:47) の編集履歴(バックアップ)
NSObject プロトコルリファレンス 翻訳元
このページの最終更新:2010-02-15
ADCの最終更新:2008-12-22
ADCの最終更新:2008-12-22
準拠しているクラス | NSObject |
フレームワーク | /System/Library/Frameworks/Foundation.framework |
使用可能な環境 | Mac OS X v10.0以降 |
宣言ファイル | NSObject.h |
コンパニオンガイド | Cocoa Fundamentals Guide Memory Management Programming Guide for Cocoa |
概観(Overview)
NSObjectプロトコルは全てのObjective-Cオブジェクトの根幹をなすメソッドをまとめています。
このプロトコルに準拠しているオブジェクトは、ファーストクラスオブジェクトであると考えることができます。このようなオブジェクトには以下のことが要求されます。
このプロトコルに準拠しているオブジェクトは、ファーストクラスオブジェクトであると考えることができます。このようなオブジェクトには以下のことが要求されます。
- クラスであること。クラス階層内での位置づけ。
- プロトコルに準拠していること。
- 各メッセージに反応できること。
また、このプロトコルのretain,release,autoreleaseメソッドを実装しているオブジェクトは、ファンデーションで定義されているオブジェクトの管理と解放の仕組みの中に組み込むことができます(詳細については、Memory Management Programming Guide for Cocoaなどを参照してください)。要するに、NSObjectプロトコルに準拠しているオブジェクトはNSArrayやNSDictionary等で定義されるコンテナオブジェクトを使って管理できるようになるのです。
CocoaのルートクラスであるNSObjectはこのプロトコルに準拠しているので、NSObjectを継承する全てのオブジェクトはこのプロトコルに記述された性質を持っています。
CocoaのルートクラスであるNSObjectはこのプロトコルに準拠しているので、NSObjectを継承する全てのオブジェクトはこのプロトコルに記述された性質を持っています。
このクラスでできること(Tasks)
クラスの識別(Identifying Classes)
– class required method – superclass required method
オブジェクト比較の関係(Identifying and Comparing Objects)
– isEqual: required method – hash required method – self required method
リフェレンスカウントの管理(Managing Reference Counts)
– retain required method – release required method – autorelease required method – retainCount required method
オブジェクトの継承関係、機能、準拠の確認(Testing Object Inheritance, Behavior, and Conformance)
– isKindOfClass: required method – isMemberOfClass: required method – respondsToSelector: required method – conformsToProtocol: required method
オブジェクトの記述(Describing Objects)
– description required method
メッセージ送信(Sending Messages)
– performSelector: required method – performSelector:withObject: required method – performSelector:withObject:withObject: required method
ゾーンの決定(Determining Allocation Zones)
– zone required method
プロキシの識別(Identifying Proxies)
– isProxy required method