id
is a pointer to any type, but unlike void *
it always points to an Objective-C object. For example, you can add anything of type id
to an NSArray, but those objects must respond to retain
and release
.
The compiler is totally happy for you to implicitly cast any object to id
, and for you to cast id
to any object. This is unlike any other implicit casting in Objective-C, and is the basis for most container types in Cocoa.
Related Posts:
- What does \0 stand for?
- Difference between nil, NIL and, null in Objective-C
- printf(“%%%s”,”hello”)
- Compiler error: “initializer element is not a compile-time constant”
- What is causing this: Cannot jump from switch statement to this case label
- Decode String with Emoji characters such as \ud83d
- Include of non-modular header inside framework module
- Difference between nil, NIL and, null in Objective-C
- Which is the difference between Long.valueOf(0) and 0L in Java?
- Why has the int32 type a maximum value of 2³¹ − 1? [duplicate]
- Why in C++ do we use DWORD rather than unsigned int? [duplicate]
- Is there a Boolean data type in Microsoft SQL Server like there is in MySQL? [duplicate]
- Double precision floating values in Python?
- Double precision floating values in Python?
- What’s the canonical way to check for type in Python?
- TypeError: ‘float’ object is not callable
- Xcode build failure “Undefined symbols for architecture x86_64”
- “X does not name a type” error in C++
- Linker Command failed with exit code 1 (use -v to see invocation), Xcode 8, Swift 3
- What is uintptr_t data type
- TypeError: ‘str’ object cannot be interpreted as an integer [duplicate]
- “X does not name a type” error in C++
- Linker Command failed with exit code 1 (use -v to see invocation), Xcode 8, Swift 3
- Long vs Integer, long vs int, what to use and when?
- What is uintptr_t data type
- What does int & mean
- YAML equivalent of array of objects in JSON
- What is dtype(‘O’), in pandas?
- “unrecognized selector sent to instance” error in Objective-C
- What is dtype(‘O’), in pandas?
- How to determine a Python variable’s type?
- Change column type in pandas
- Determine the type of an object?
- what is the unsigned datatype?
- Pointtype command for gnuplot
- Thread 1: EXC_BAD_ACCESS (code=1, address=0xf00000c)
- How to use iMonkey in an iOS app
- “X does not name a type” error in C++
- Check if a value is an object in JavaScript
- Accessing elements by type in JavaScript
- How to check if type of a variable is string?
- What does int & mean
- Difference between numeric, float and decimal in SQL Server
- If Java is Strongly typed then why does this code compile?
- Convert a byte array to integer in Java and vice versa
- Append a tuple to a list – what’s the difference between two ways?
- Passing just a type as a parameter in C#
- Passing just a type as a parameter in C#
- malloc: *** error: incorrect checksum for freed object – object was probably modified after being freed
- No function matches the given name and argument types
- Duplicate symbols for architecture x86_64 under Xcode
- Where to find the complete definition of off_t type?
- String was not recognized as a valid DateTime ” format dd/MM/yyyy”
- Why SQL Server throws Arithmetic overflow error converting int to data type numeric?
- Got a EXC_CORPSE_NOTIFY symbol crash, how to track it?
- Node cannot be resolved to a type
- Determining type of an object in ruby
- Python, tuple indices must be integers, not tuple?
- Incomplete type is not allowed: stringstream
- Finding the type of an object in C++
- How to create a new object instance from a Type
- Type Checking: typeof, GetType, or is?
- What primitive data type is time_t? [duplicate]
- UIButton title text color
- Pod install is staying on “Setting up CocoaPods Master repo”
- What is a `char*`?
- What is the difference between String and string in C#?
- Whats the difference between UInt8 and uint8_t
- Declaration is incompatible with type