Skip to content

Commit d7f5fa0

Browse files
committed
NSTask opens iBook from command line
1 parent a43ad57 commit d7f5fa0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ -(void) taskExample{
6363
dispatch_async(queue, ^{
6464
NSTask *task=[[NSTask alloc] init];
6565
[task setExecutableURL:[NSURL fileURLWithPath:@"/bin/sh"]];
66-
[task setArguments:[NSArray arrayWithObjects:@"-c",@"ls /Volumes", nil]];
66+
[task setArguments:[NSArray arrayWithObjects:@"-c",@"open /Applications/iBooks.app", nil]];
6767

6868
NSPipe *oPipe=[[NSPipe alloc] init];
6969
NSPipe *ePipe=[[NSPipe alloc]init];
@@ -132,6 +132,7 @@ int main(int argv, const char* argc[]){
132132
NSLog(@"Choice 1: Create a thread and trigger a timer");
133133
NSLog(@"Choice 2: Execute command line commands from a process");
134134
scanf("%i",&choice);
135+
//choice=2;
135136
EgClass *inst=[[EgClass alloc] init];
136137
if(choice==1){ //thread is triggered but not timer, resolve this issue
137138
NSThread *egThread=[[NSThread alloc] initWithTarget:inst selector:@selector(threadMethod:) object:NULL];

0 commit comments

Comments
 (0)