Skip to content

Instantly share code, notes, and snippets.

@jorbsd
Created February 19, 2010 16:24
Show Gist options
  • Save jorbsd/308852 to your computer and use it in GitHub Desktop.
Save jorbsd/308852 to your computer and use it in GitHub Desktop.
// 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 obj) {
[obj jbb_puts];
}
andErrorHandler: ^(NSError *localError) {
}];
__block NSString *testString = nil;
[[NSString jbb_invocationWithSelector:@selector(stringWithCString:encoding:), "this is another test", NSUTF8StringEncoding]
jbb_invokeWithContinuation: ^(id obj) {
testString = [obj retain];
}
andErrorHandler: ^(NSError *localError) {
}];
[testString jbb_puts];
[testString release];
[[NSString jbb_invocationWithSelector:@selector(stringWithContentsOfFile:encoding:error:), @"/tmp/fake_file", NSUTF8StringEncoding, nil]
jbb_invokeWithContinuation: ^(id obj) {
}
andErrorHandler: ^(NSError *localError) {
[[NSString stringWithFormat:@"Error occurred: %@", localError] jbb_puts];
}];
[localPool drain];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment