diff options
author | Yannick Loriot <yannick.loriot@gmail.com> | 2013-08-13 15:52:11 +0200 |
---|---|---|
committer | Yannick Loriot <yannick.loriot@gmail.com> | 2013-08-13 15:52:11 +0200 |
commit | 947c137680c2699bdb118b63460c560bac1fdd3c (patch) | |
tree | 263d241618e8682e7562960b74934554a3dd62a8 /objective-c.html.markdown | |
parent | 0bd403fdb935331c3c391ffd79f0245032dee3b5 (diff) |
minor fixes
Diffstat (limited to 'objective-c.html.markdown')
-rw-r--r-- | objective-c.html.markdown | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/objective-c.html.markdown b/objective-c.html.markdown index 284eca92..fc4b2900 100644 --- a/objective-c.html.markdown +++ b/objective-c.html.markdown @@ -37,29 +37,30 @@ int main (int argc, const char * argv[]) NSLog(@"Hello %@!", worldString); // Print "Hello World!" // Character literals - NSNumber *theLetterZ = @'Z'; - NSLog(@"%c", [theLetterZ charValue]); + NSNumber *theLetterZNumber = @'Z'; + char theLetterZ = [theLetterZNumber charValue]; + NSLog(@"%c", theLetterZ); // Integral literals NSNumber *fortyTwoNumber = @42; - int fortyTwo = [fortyTwo intValue]; + int fortyTwo = [fortyTwoNumber intValue]; NSLog(@"%i", fortyTwo); NSNumber *fortyTwoUnsignedNumber = @42U; - unsigned int fortyTwoUnsigned = [fortyTwoUnsigned unsignedIntValue]; + unsigned int fortyTwoUnsigned = [fortyTwoUnsignedNumber unsignedIntValue]; NSLog(@"%u", fortyTwoUnsigned); NSNumber *fortyTwoLongNumber = @42L; - long fortyTwoLong = [aLong longValue]; + long fortyTwoLong = [fortyTwoLongNumber longValue]; NSLog(@"%li", fortyTwoLong); // Floating point literals NSNumber *piFloatNumber = @3.141592654F; - float piFloat = [piFloat floatValue]; + float piFloat = [piFloatNumber floatValue]; NSLog(@"%f", piFloat); NSNumber *piDoubleNumber = @3.1415926535; - piDouble = [piDouble doubleValue]; + piDouble = [piDoubleNumber doubleValue]; NSLog(@"%f", piDouble); // BOOL literals |