• 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: Threads and Locking Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threads and Locking Question


  • Subject: Re: Threads and Locking Question
  • From: Ken Thomases <email@hidden>
  • Date: Thu, 10 May 2012 16:55:03 -0500

On May 10, 2012, at 4:44 PM, Dave wrote:

> Thanks for that I will try it out tomorrow, as an aside, is this ok/recommended?
>
> -(void) someMethod:(NSString*) theParameter
> {
> if ([NSThread isMainThread)
> 	{
> 	[self performSelectorInBackground:@selector(someMethod:) withObject:self];

Presumably, you mean "withObject:theParameter".

> 	return;
> 	}
>
> //  Do work
>
> }

As to whether it's OK/recommended, that depends.  Why are you doing this?  The caller of that method may be very surprised if it's asynchronous.

Regards,
Ken


_______________________________________________

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: Threads and Locking Question
      • From: Dave <email@hidden>
References: 
 >[ANN] Online ScriptingBridge documentation archive (From: "email@hidden" <email@hidden>)
 >Threads and Locking Question (From: Dave <email@hidden>)
 >Re: Threads and Locking Question (From: Ken Thomases <email@hidden>)
 >Re: Threads and Locking Question (From: Dave <email@hidden>)

  • Prev by Date: Re: Threads and Locking Question
  • Next by Date: Re: Threads and Locking Question
  • Previous by thread: Re: Threads and Locking Question
  • Next by thread: Re: Threads and Locking Question
  • Index(es):
    • Date
    • Thread