Created
March 12, 2010 19:27
-
-
Save jorbsd/330669 to your computer and use it in GitHub Desktop.
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
// clang -ggdb -arch x86_64 -Wl,-rpath,/Users/jordan/Build/JBBAdditions/Release -F/Users/jordan/Build/JBBAdditions/Release -o test test.m -framework JBBAdditions -framework Cocoa | |
// clang -arch i386 -arch x86_64 -Wl,-rpath,/Users/jordan/Build/JBBAdditions/Release -F/Users/jordan/Build/JBBAdditions/Release -o test test.m -framework JBBAdditions -framework Cocoa | |
#import <stdlib.h> | |
#import <stdio.h> | |
#import <Cocoa/Cocoa.h> | |
#import <JBBAdditions/JBBAdditions.h> | |
int main(int argc, char *argv[]) { | |
NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init]; | |
[[NSString jbb_invocationProxy] stringWithCString:"this is a test" encoding:NSUTF8StringEncoding continuation:^(id anObject) { | |
[anObject jbb_puts]; | |
}]; | |
__block NSString *testString = nil; | |
[[NSString jbb_invocationProxy] stringWithCString:"this is another test" encoding:NSUTF8StringEncoding continuation:^(id anObject) { | |
testString = [anObject retain]; | |
}]; | |
[[testString autorelease] jbb_puts]; | |
[[NSString jbb_invocationProxy] stringWithContentsOfFile:@"/tmp/fake_file" encoding:NSUTF8StringEncoding error:nil continuation:^(id anObject) { | |
[@"this is a third test" jbb_puts]; | |
} | |
errorHandler:^(NSError *anError) { | |
[[NSString stringWithFormat:@"this is an error: %@", anError] jbb_puts]; | |
}]; | |
[[@"This is a test" jbb_invocationProxy] rangeOfString:@"test" options:NSBackwardsSearch continuation:^(id anObject) { | |
NSRange returnedRange; | |
[anObject getValue:&returnedRange]; | |
[[NSString stringWithFormat:@"this is a test of NSRange {%i, %i}", returnedRange.location, returnedRange.length] jbb_puts]; | |
}]; | |
[localPool drain]; | |
return 0; | |
} |
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
test.m:14:5: warning: method '-stringWithCString:encoding:continuation:' not found (return type defaults to 'id') | |
[[NSString jbb_invocationProxy] stringWithCString:"this is a test" encoding:NSUTF8StringEncoding continuation:^(id anObject) { | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
test.m:19:5: warning: method '-stringWithCString:encoding:continuation:' not found (return type defaults to 'id') | |
[[NSString jbb_invocationProxy] stringWithCString:"this is another test" encoding:NSUTF8StringEncoding continuation:^(id anObject) { | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
test.m:24:5: warning: method '-stringWithContentsOfFile:encoding:error:continuation:errorHandler:' not found (return type defaults to 'id') | |
[[NSString jbb_invocationProxy] stringWithContentsOfFile:@"/tmp/fake_file" encoding:NSUTF8StringEncoding error:nil continuation:^(id anObject) { | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
test.m:31:5: warning: method '-rangeOfString:options:continuation:' not found (return type defaults to 'id') | |
[[@"This is a test" jbb_invocationProxy] rangeOfString:@"test" options:NSBackwardsSearch continuation:^(id anObject) { | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
4 diagnostics generated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment