• 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
Re: More on NSTask and output to NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More on NSTask and output to NSTextView


  • Subject: Re: More on NSTask and output to NSTextView
  • From: Koen van der Drift <email@hidden>
  • Date: Sat, 12 Jun 2004 12:58:47 -0400

Hi,

Still struggling a little bit with getting this to work. I use an NSThread to retrieve and display the data from the task:

[NSThread detachNewThreadSelector:@selector(getData:) toTarget:self withObject:nil];

where the getData method retrieves the data and displays it. This works fine, but I noticed that sometimes not all output is displayed. So I created a small test project that runs the command "ls -la -R /Library" and displays the output. I added the possiblilty to use a thread to display the data by using the flag USE_THREAD. If that flag is on, than (on my system) the output is very short. However, if I set the flag to 0, the textview shows all data, but I am unable to cancel the task.

I would appreciate it if someone could have a look at the code and see if they can reproduce this, and even better, spot the error I made. You can find it at http://home.earthlink.net/~kvddrift/software/threadTest.tar.gz



many thanks,

- Koen.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >More on NSTask and output to NSTextView (From: Koen van der Drift <email@hidden>)
 >Re: More on NSTask and output to NSTextView (From: "Louis C. Sacha" <email@hidden>)

  • Prev by Date: Big Nerd Ranch Experience
  • Next by Date: Re: Getting process status
  • Previous by thread: Re: More on NSTask and output to NSTextView
  • Next by thread: [Newbie] Who's changing my radius?
  • Index(es):
    • Date
    • Thread