• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Reading data from an NSTask
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reading data from an NSTask


  • Subject: Reading data from an NSTask
  • From: Ken Tozier <email@hidden>
  • Date: Mon, 4 Jul 2005 12:50:47 -0400

Hi

I created an NSTask to run nibtool and am seeing the result in the run log, but so far haven't had any luck at pulling the data out of the task. Anyone see the problem in the below snippet?

NSTask *testTask1 = [NSTask launchedTaskWithLaunchPath: @"/ usr/bin/nibtool"
arguments: [NSArray arrayWithObjects: @"-a", @"/Users/kentozier/Desktop/TestNib.nib", nil]];


// if I step through in the debugger, it hangs on the next line.
// The run log however shows that the nib data exists somewhere as it get printed.
NSData *test1Data = [[testTask1 standardOutput] readDataToEndOfFile];


NSString    *testString    = [[NSString alloc] initWithData: test1Data
                                encoding: NSUnicodeStringEncoding];

// the code never seems to make it to here
NSLog(@"standard output = %@", testString);

Thanks

Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Reading data from an NSTask
      • From: Pontus Ilbring <email@hidden>
    • Re: Reading data from an NSTask
      • From: j o a r <email@hidden>
  • Prev by Date: NSCharacterSet Parsing MS Word 97 files? <Newbie>
  • Next by Date: Re: NSCharacterSet Parsing MS Word 97 files? <Newbie>
  • Previous by thread: Re: NSCharacterSet Parsing MS Word 97 files? <Newbie>
  • Next by thread: Re: Reading data from an NSTask
  • Index(es):
    • Date
    • Thread