• 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: Wait for NSTask to finish
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Wait for NSTask to finish


  • Subject: Re: Wait for NSTask to finish
  • From: Rakka <email@hidden>
  • Date: Thu, 17 Mar 2005 07:07:38 +1100


On Mar 16, 2005, at 10:52 PM, Will Mason wrote:

Is there a way to wait for an NSTask (or a method I created) to
finish
before continuing like waitUntilExit, but doesn't cause my app to
hang/become unresponsive?

It seems that you want to wait for the NSTask to finish and not wait
around for the NSTask at the same time. Can you let your app continue
and respond to the NSTaskDidTerminateNotification when you receive it?
What behavior exactly are you looking for?

Thanks,
Will

I don't think I can use NSTaskDidTerminateNotification as after it's done, the app goes on to run another command, if the user prefs are set to do so. It looks a bit like this.

- (id)sender
{
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"batchRPOn"])
{
[task waitUntilExit];
[self rp:nil];
}
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"batchRCOn"])
{
[task waitUntilExit];
[self rc:nil];
}
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"batchUPOn"])
{
[task waitUntilExit];
[self up:nil];
}
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"batchCCOn"])
{
[task waitUntilExit];
[self cuc:nil];
}
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"batchFETOn"])
{
[task waitUntilExit];
[self fet:nil];
}

}


But, as I said before, the app hangs and the cancel button won't work, etc...

Thanks a lot,
 _______________________________________________
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: Wait for NSTask to finish
      • From: John Timmer <email@hidden>
    • Re: Wait for NSTask to finish
      • From: Shawn Erickson <email@hidden>
References: 
 >Re: Wait for NSTask to finish (From: Will Mason <email@hidden>)

  • Prev by Date: Re: When is the 'Open Recent' submenu populated?
  • Next by Date: Re: Wait for NSTask to finish
  • Previous by thread: Re: Wait for NSTask to finish
  • Next by thread: Re: Wait for NSTask to finish
  • Index(es):
    • Date
    • Thread