Created
October 29, 2012 15:51
-
-
Save sebastienwindal/3974316 to your computer and use it in GitHub Desktop.
messages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // what do you get? | |
| // compile error? | |
| // compile warning? | |
| // runtime crash? | |
| // value X displayed on console. | |
| // 1. | |
| NSString *str1 = @"hello"; | |
| NSLog(@"%d", [str1 length]); | |
| // 2. | |
| NSString *str2 = @"hello"; | |
| NSLog(@"%d", str2.length); | |
| // 3. | |
| NSString *str3; | |
| NSLog(@"%d", [str3 length]); | |
| // 4. | |
| NSString *str4 = nil; | |
| NSLog(@"%d", [str4 length]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment