• 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
Sending NSString to NSThread task
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sending NSString to NSThread task


  • Subject: Sending NSString to NSThread task
  • From: "Peter Karlsson" <email@hidden>
  • Date: Wed, 15 Dec 2004 11:10:43 +0100

Dear list!

How do I send the NSString 'action' in myAction to the threadTask? Here is
my code.

- (void)myAction:(NSString*)action
{
>>>I have the string here

	// start thread
	[NSThread detachNewThreadSelector:@selector(threadTask) toTarget:self
withObject:nil];
}

- (void)threadTask
{
	NSAutoreleasePool *pool = [NSAutoreleasePool new];

>>>I need the string here

	// exit thread
	[pool release];
	[NSThread exit];
}

Best regards Peter

 _______________________________________________
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: Sending NSString to NSThread task
      • From: j o a r <email@hidden>
  • Prev by Date: NSImage lockFocus in DrawRect while printing
  • Next by Date: NSSocketPort bug?
  • Previous by thread: Re: NSImage lockFocus in DrawRect while printing
  • Next by thread: Re: Sending NSString to NSThread task
  • Index(es):
    • Date
    • Thread