Data Types and Expressions(Chapter 4 of Programming in Objective-C 2.0)
2010-10-15 12:54
801 查看
The id data type is used to store an object of any type. In a sense, it is a generic object type. For example, this line declares number to be a variable of type id: id number; Methods can be declared to return values of type id, like so: -(id) newObject: (int) type; This declares an instance method called newObject that takes a single integer argument called type and returns a value of type id. Note that id is the default type for return and argument type declarations. So, the following declares a class method that returns a value of type id: +allocInit;
相关文章推荐
- More on Variables and Data Types(Chapter 10 of Programming in Objective-C 2.0)
- Categories and Protocols(Chapter 11 of Programming in Objective-C 2.0)
- Polymorphism, Dynamic Typing, and Dynamic Binding(Chapter 9 of Programming in Objective-C 2.0)
- Archiving(Chapter 18 of Programming in Objective-C 2.0)
- Numbers, Strings, and Collections(Chapter 15 of Programming in Objective-C 2.0)
- Classes, Objects, and Methods(Chapter 3 of Programming in Objective-C 2.0)
- Making Decisions(Chapter 6 of Programming in Objective-C 2.0)
- More on Classes(Chapter 7 of Programming in Objective-C 2.0)
- Working with Files(Chapter 16 of Programming in Objective-C 2.0)
- The Preprocessor(Chapter 12 of Programming in Objective-C 2.0)
- Inheritance(Chapter 8 of Programming in Objective-C 2.0)
- Copying Objects(Chapter 17 of Programming in Objective-C 2.0)
- The study of chapter 13 in programming windows with mfc-printing with document and views
- Summarizes chapter one of datastructures and program design in C++
- 6.087 Practical Programming in C, lec2: Variables and datatypes, operators.
- Types and Declarations(Chapter 4 of The C++ Programming Language)
- Expressions and Statements(Chapter 6 of The C++ Programming Language)
- Chapter 2 – Types, Operators and Expressions of TCPL
- This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary log
- This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary