Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
A nil receiver always returns nil or 0 to the caller as long as the caller is expecting the message to return one of the variable types in Table 7-1. The compatible variable types are essentially any pointer or scalar.
| Return Type | Returned Value |
|---|---|
| id | nil |
| Pointer to any type | NULL |
| BOOL | NO |
| (unsigned) char | '\0' |
| (unsigned) int | 0 |
| (unsigned) long int | 0L |
| (unsigned) long long int | 0LL |
| float | 0.0f |
| double | 0.0 |
| long double | 0.0 |