Created
December 27, 2011 02:59
-
-
Save KatagiriSo/1522593 to your computer and use it in GitHub Desktop.
NSTask
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
NSTask *task = [[NSTask alloc] init]; | |
NSPipe *pipe = [[NSPipe alloc] init]; | |
[task setStandardOutput:pipe]; | |
NSString *launchPath = @"/Applications/Preview.app/Contents/MacOS/Preview"; | |
NSArray *args_ = [NSArray arrayWithObjects:@"/Users/katagiriso/Documents/tmp.pdf",nil]; | |
[task setLaunchPath:launchPath]; | |
[task setArguments:args_]; | |
[task launch]; | |
//[task waitUntilExit]; | |
//NSFileHandle *handle = [pipe fileHandleForReading]; | |
//NSData *data = [handle readDataToEndOfFile]; | |
[task release]; | |
[pipe release]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment