This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
ios-labs-s14:basics-objects [2014/02/26 13:00] mbarboi |
ios-labs-s14:basics-objects [2014/02/26 13:05] mbarboi |
||
---|---|---|---|
Line 59: | Line 59: | ||
Pointers are a part of regular C and are used because they are more efficient. When we use pointers in our programs, we only need to store and copy a simple pointer, which is really just an address for a space in memory. It’s a relatively small piece of data compared to the object itself. | Pointers are a part of regular C and are used because they are more efficient. When we use pointers in our programs, we only need to store and copy a simple pointer, which is really just an address for a space in memory. It’s a relatively small piece of data compared to the object itself. | ||
- | For example, it’s much more efficient to simply point to the location for a large video file and use that pointer multiple times in code than to actually have to use all the data of that large video file every time we access it in code. | + | Note on asterixes: all objective-c objects must be declared with the asterix as shown. **Primitives** and **structs** are not declared with an asterix. |
+ | -Primitivies- simple variables, commonly those that contain numbers. Examples: boolean, integer, double, float. | ||
+ | -Structs- a way of grouping variables together in C. Example: CGRect. |