Created
August 28, 2011 18:20
-
-
Save chrisdevereux/1177004 to your computer and use it in GitHub Desktop.
Revisions
-
chrisdevereux created this gist
Aug 28, 2011 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ #import <Cocoa/Cocoa.h> @protocol IdMethod + (id) method; @end @interface IdClass : NSObject <IdMethod> @end @implementation IdClass + (id) method { return @"hello!!"; } @end @protocol StructMethod + (NSRect) method; @end @interface StructClass : NSObject <StructMethod> @end @implementation StructClass + (NSRect) method { return CGRectMake(5,5,5,5); } @end int main (int argc, char const *argv[]) { NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; Class<IdMethod> a = [IdClass class]; NSLog(@"%@", [a method]); Class<StructMethod> b = [StructClass class]; NSLog(@"%@", NSStringFromRect([b method])); [pool drain]; return 0; }