Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page >

Objective-C:nilへのメッセージ

Objective-Cでは、nilオブジェクトへメッセージを送信することできます。Objective-Cランタイムは、nilオブジェクトへ送信されたメッセージの戻り値は、メッセージがオブジェクトまたはsizeof(void*)以下のサイズの整数型スカラー値を返すかぎり、nilであると想定します。

インテルベースのMacintoshコンピュータでは、nilオブジェクトへのメッセージは、戻り値の型がfloatdoublelong double、またはlong longであるメソッドには常に0.0を返します。戻り値がstructであるメソッドは、『Mac OS X ABI Function Call Guide』で定義されているようにレジスタで返されることになっているため、データ構造体のどのフィールドにも0.0を返します。その他のstructデータ型では0のみになることはありません。これはRosettaの下でも当てはまります。PowerPC Macintoshコンピュータ上では、動作は不定です。



< Previous PageNext Page >


Last updated: 2006-03-08




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice