• 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: performSelectorOnMainThread problem SOLVED
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: performSelectorOnMainThread problem SOLVED


  • Subject: Re: performSelectorOnMainThread problem SOLVED
  • From: Ben Einstein <email@hidden>
  • Date: Thu, 28 May 2009 13:13:39 -0400

Thanks for the advice, I had actually tried that as well to no avail.

After playing around a bit, I'm fairly certain I've solved it, although I'm not really sure why it was a problem. At the top of the worker method, I was locking the NSManagedObjectContext and unlocking it just before return, but all the NSManagedObject stuff should be happening on a separate thread. I'll try to track that down in a minute, but it appears that was blocking the main thread. I suppose I should have asked Instruments before asking you all.

Thanks for your help!
Ben

On May 28, 2009, at 1:03 PM, Corbin Dunn wrote:


On May 28, 2009, at 9:46 AM, Ben Einstein wrote:


On May 28, 2009, at 12:36 PM, Jeff Johnson wrote:

Three general possibilities:

(1) aControllerObject is nil.

Definitely not the problem because it works when calling performSelector: without the mainThread part.


(2) The main run loop is not running for some reason.

The main run loop is waiting to hear back from the completion of the worker thread, so this isn't the problem.


(3) The main run loop is not running in one of NSRunLoopCommonModes.

I would guess this is the most likely option as well, but NSRunLoop says mainRunLoop is kCFRunLoopDefaultMode, which is correct, right?

For kicks, toss in modes:[NSArray arrayWithObject:NSRunLoopCommonModes]]


And/or give us a bt of your main thread when the message fails. Chances are, it hasn't failed, it just hasn't processed it yet.

corbin


_______________________________________________

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: performSelectorOnMainThread problem SOLVED
      • From: Jason Foreman <email@hidden>
References: 
 >performSelectorOnMainThread problem (From: Ben Einstein <email@hidden>)
 >Re: performSelectorOnMainThread problem (From: Jeff Johnson <email@hidden>)
 >Re: performSelectorOnMainThread problem (From: Ben Einstein <email@hidden>)
 >Re: performSelectorOnMainThread problem (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Re: performSelectorOnMainThread problem
  • Next by Date: RE: SQLite/MySQL BLOB-creator application needed.
  • Previous by thread: Re: performSelectorOnMainThread problem
  • Next by thread: Re: performSelectorOnMainThread problem SOLVED
  • Index(es):
    • Date
    • Thread