Commits

Peter Hosey committed 4e231ff

Improved the test app, both using property-access syntax and logging the termination status when the process exits.

  • Participants
  • Parent commits b08dc03

Comments (0)

Files changed (1)

PRHTaskTest/PRHTaskTest/main.m

 	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
 
 	PRHTask *task = [[[PRHTask alloc] init] autorelease];
-	[task setLaunchPath:@"/usr/bin/true"];
+	task.launchPath = @"/usr/bin/true";
+	task.successfulTerminationBlock = ^(PRHTask *completedTask) {
+		NSLog(@"Completed task: %@ with exit status: %i", completedTask, completedTask.terminationStatus);
+	};
 	[task launch];
 
 	[pool drain];