Created
March 3, 2010 22:52
-
-
Save jorbsd/321143 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_invocationWithSelector:@selector(stringWithCString:encoding:), "this is a test", NSUTF8StringEncoding] | |
jbb_invokeWithContinuation:^(id anObject) { | |
[anObject jbb_puts]; | |
} | |
errorHandler:^(NSError *anError) { | |
}]; | |
__block NSString *testString = nil; | |
[[NSString jbb_invocationWithSelector:@selector(stringWithCString:encoding:), "this is another test", NSUTF8StringEncoding] | |
jbb_invokeWithContinuation:^(id anObject) { | |
testString = [anObject retain]; | |
} | |
errorHandler:^(NSError *anError) { | |
}]; | |
[testString jbb_puts]; | |
[testString release]; | |
[[NSString jbb_invocationWithSelector:@selector(stringWithContentsOfFile:encoding:error:), @"/tmp/fake_file", NSUTF8StringEncoding, nil] | |
jbb_invokeWithContinuation:^(id anObject) { | |
[@"this is a third test" jbb_puts]; | |
} | |
errorHandler:^(NSError *anError) { | |
[[NSString stringWithFormat:@"this is an error: %@", anError] 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
// clang -ggdb -arch x86_64 -Wl,-rpath,/Users/jordan/Build/JBBAdditions/Release -F/Users/jordan/Build/JBBAdditions/Release -o test2 test2.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 test2 test2.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]; | |
[[JBBContinuationProxy proxyWithTarget:[NSString self] | |
continuation:^(id anObject) { | |
[anObject jbb_puts]; | |
} | |
errorHandler:^(NSError *anError) {}] stringWithCString:"this is a test" encoding:NSUTF8StringEncoding]; | |
__block NSString *testString = nil; | |
[[JBBContinuationProxy proxyWithTarget:[NSString self] | |
continuation:^(id anObject) { | |
testString = [anObject retain]; | |
} | |
errorHandler:^(NSError *anError) {}] stringWithCString:"this is another test" encoding:NSUTF8StringEncoding]; | |
[testString jbb_puts]; | |
[testString release]; | |
[[JBBContinuationProxy proxyWithTarget:[NSString self] | |
continuation:^(id anObject) { | |
[@"this is a third test" jbb_puts]; | |
} | |
errorHandler:^(NSError *anError) { | |
[[NSString stringWithFormat:@"this is an error: %@", anError] jbb_puts]; | |
}] stringWithContentsOfFile:@"/tmp/fake_file" encoding:NSUTF8StringEncoding error:nil]; | |
[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
// clang -ggdb -arch x86_64 -Wl,-rpath,/Users/jordan/Build/JBBAdditions/Release -F/Users/jordan/Build/JBBAdditions/Release -o test3 test3.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 test3 test3.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_proxyWithContinuation:^(id anObject) { | |
[anObject jbb_puts]; | |
} | |
errorHandler:^(NSError *anError) {}] stringWithCString:"this is a test" encoding:NSUTF8StringEncoding]; | |
__block NSString *testString = nil; | |
[[NSString jbb_proxyWithContinuation:^(id anObject) { | |
testString = [anObject retain]; | |
} | |
errorHandler:^(NSError *anError) {}] stringWithCString:"this is another test" encoding:NSUTF8StringEncoding]; | |
[testString jbb_puts]; | |
[testString release]; | |
[[NSString jbb_proxyWithContinuation:^(id anObject) { | |
[@"this is a third test" jbb_puts]; | |
} | |
errorHandler:^(NSError *anError) { | |
[[NSString stringWithFormat:@"this is an error: %@", anError] jbb_puts]; | |
}] stringWithContentsOfFile:@"/tmp/fake_file" encoding:NSUTF8StringEncoding error:nil]; | |
NSString *testString2 = [[NSString jbb_proxy] stringWithCString:"this is another test" encoding:NSUTF8StringEncoding]; | |
NSUInteger testInt = [[@"hello, world" jbb_proxy] length]; | |
[[NSString stringWithFormat:@"\n\nlast two tests: %@, %u", testString2, testInt] jbb_puts]; | |
[localPool drain]; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment