• 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
Sharing objects between threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sharing objects between threads


  • Subject: Sharing objects between threads
  • From: "Mike O'Connor" <email@hidden>
  • Date: Fri, 25 Jun 2004 00:15:07 -0400

I have several objects I want to share between two threads. Locking is not the problem, rather I keep running into "NSDistantObject access attempted from another thread" errors.

I have some objects (classes) I've created, and I place them into an NSArray. Then I pass that array as the withObject argument to detachNewThreadSelector.

My thread gets the array ok, but when I try to use one of the objects [myObjectFromArray message], I get the distant object error.

What's the proper way to share several objects between threads? Can't I just move the id across somehow and use it, since it's all in the same app, without it changing into a distant object?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Sharing objects between threads
      • From: Chris Hanson <email@hidden>
    • Re: Sharing objects between threads
      • From: 陳銘崧(James Chen) <email@hidden>
  • Prev by Date: RE: View change Buttons like in finder
  • Next by Date: Cocoa Java resources?
  • Previous by thread: NSTabView drawing glitches
  • Next by thread: Re: Sharing objects between threads
  • Index(es):
    • Date
    • Thread