Have a look at the following code example:
1 2 3 |
NSString* str1 = NSString.alloc.init; NSString* str2 = str1.copy; NSLog(@"str1: %@, str2: %@", str1.capitalizedString, str2.description); |
Did you find it strange somehow? Odd perhaps? Then you may be surprised to learn that this is perfectly valid Objective-C code. Go ahead and try it in your project. As long as the project is set to use the Apple LLVM Compiler this will work.