Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@alloy
Last active August 29, 2015 13:57
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alloy/9830968 to your computer and use it in GitHub Desktop.
Save alloy/9830968 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
@interface WTF : NSObject
-:x;
@end
@implementation WTF
-:x;
{
return x;
}
@end
int
main()
{
NSLog(@"%@", [[WTF new] :@(42)]);
return 0;
}
$ /Users/eloy/Code/ObjectiveC/objc-run/objc-run test.m
2014-03-28 12:53:53.665 test[93801:507] 42
@yas375
Copy link

yas375 commented Mar 28, 2014

I didn't know about objc-run before. I was using CodeRunner for such things. Thanks! :)

@seivan
Copy link

seivan commented Mar 28, 2014

Same here! Thanks for pointing out objc-run!

@slavikus
Copy link

Now make a method that accepts no arguments ;)

@jeremytregunna
Copy link

It still has a name. Its name is :.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment