• 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: Running an NSTask Within an NSThread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running an NSTask Within an NSThread


  • Subject: Re: Running an NSTask Within an NSThread
  • From: Quincey Morris <email@hidden>
  • Date: Sun, 27 Jan 2008 15:18:20 -0800

On Jan 27, 2008, at 14:06, Jonathan Dann wrote:

// NSDocument subclass implementation
- (IBAction)runTask:(id)sender;
{
TaskController *tC = [[TaskController defaultControllerForDocument:self];
[tC performTask];
}



// TaskController.m

+ (TaskController *)defaultController;
{
TaskController *controller = [[self alloc] init];
return [controller autorelease];
}

It occurs to me, based solely on the code you posted, that there's really no need for a TaskController at all. Why isn't your document subclass itself the task controller? It's as much work to make the document subclass keep track of the TaskController as it is to make the document subclass keep track of the NSTask directly (if not more).


The only reason for a separate TaskController would be if it had to run in a separate thread, which you were talking about earlier. But everything that you show TaskController doing looks like it would work fine in the main thread.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Running an NSTask Within an NSThread (From: Jonathan Dann <email@hidden>)

  • Prev by Date: Re: Running an NSTask Within an NSThread
  • Next by Date: Re: Running an NSTask Within an NSThread
  • Previous by thread: Re: Running an NSTask Within an NSThread
  • Next by thread: Re: Running an NSTask Within an NSThread
  • Index(es):
    • Date
    • Thread