• 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
Using NSThreads in command-line apps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using NSThreads in command-line apps


  • Subject: Using NSThreads in command-line apps
  • From: ben syverson <email@hidden>
  • Date: Thu, 15 May 2008 13:42:04 -0500

Hi all,

I have a bit of a dilemma. I'm working on a Foundation-based command- line utility that needs to manage a few threads. The obvious choice is NSThread, since it's nice and clean.

Actually, I'm able to spawn new threads perfectly well. The problem is that I can't (?) use performSelectorOnMainThread: because I'm not an NSApplication, and so I don't get the default "main" thread that loops for user input...

Am I busted? I would like to be able to run this app without the window server running (ie, in Single User Mode), because it's server software.

I can always fall back to POSIX threads, but I'd rather use NSThread if possible. Is there an alternate way to have my spawned NSThreads call back to a controller thread (that doesn't require 10.5)?

Thanks!

- ben

_______________________________________________

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


  • Follow-Ups:
    • Re: Using NSThreads in command-line apps
      • From: Jens Alfke <email@hidden>
    • Re: Using NSThreads in command-line apps
      • From: Uli Kusterer <email@hidden>
    • Re: Using NSThreads in command-line apps
      • From: Randall Meadows <email@hidden>
    • Re: Using NSThreads in command-line apps
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Re: html
  • Next by Date: Re: Launching Cocoa Application externally
  • Previous by thread: Re: cocoa mentoring - Berlin, Germany
  • Next by thread: Re: Using NSThreads in command-line apps
  • Index(es):
    • Date
    • Thread