mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-26 09:21:00 +03:00
minor fixes
This commit is contained in:
parent
0040ce616b
commit
25f4c7e80a
@ -36,14 +36,16 @@ int main (int argc, const char * argv[])
|
|||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
|
|
||||||
// Primitive declarations
|
// Primitive declarations
|
||||||
int myPrimitive;
|
int myPrimitive1;
|
||||||
|
long myPrimitive2;
|
||||||
|
|
||||||
// Object declarations
|
// Object declarations
|
||||||
// Put the * in front of the variable names for strongly-typed object declarations
|
// Put the * in front of the variable names for strongly-typed object declarations
|
||||||
MyClass *myObject1; // Strong typing
|
MyClass *myObject1; // Strong typing
|
||||||
id myObject2; // Weak typing
|
id myObject2; // Weak typing
|
||||||
// %@ is an object
|
// %@ is an object
|
||||||
NSLog(@"%@ and %@", myObject1, myObject2); // Print "(null) and (null)"
|
// 'description' is a convention to display the value of the Objects
|
||||||
|
NSLog(@"%@ and %@", myObject1, [myObject2 description]); // Print "(null) and (null)"
|
||||||
|
|
||||||
// String
|
// String
|
||||||
NSString *worldString = @"World";
|
NSString *worldString = @"World";
|
||||||
|
Loading…
Reference in New Issue
Block a user