Created
June 4, 2014 18:43
-
-
Save hashier/01bdd7d2a22e58c0f8fc to your computer and use it in GitHub Desktop.
Clang and return types
This file contains 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
2014-06-04 20:43:10.363 Untitled 9[49902:507] Output: http://www.apple.com | |
2014-06-04 20:43:10.365 Untitled 9[49902:507] Output: NSString |
This file contains 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
#import <Foundation/Foundation.h> | |
@interface ExampleClass : NSObject | |
- (NSString *)meh; | |
- (NSURL *)muh; | |
@end | |
@implementation ExampleClass | |
- (NSString *)meh { | |
return [NSURL URLWithString:@"http://www.apple.com"]; | |
} | |
- (NSString *)muh { | |
return @"NSString"; | |
} | |
@end | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
ExampleClass *tmp = [[ExampleClass alloc] init]; | |
NSLog(@"Output: %@", [tmp meh]); | |
NSLog(@"Output: %@", [tmp muh]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment