• 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: Core Data: Progress bar using Sheet, modifying context in thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data: Progress bar using Sheet, modifying context in thread


  • Subject: Re: Core Data: Progress bar using Sheet, modifying context in thread
  • From: Andreas Mayer <email@hidden>
  • Date: Fri, 4 Aug 2006 11:12:02 +0200


Am 04.08.2006 um 06:05 Uhr schrieb Bill Coleman:

since once you call beginSheet: modalForWindow: ..., you can't do any more processing.

Why not? Did you try?
The user will not be able to interact with the parent window. But beginSheet:... returns immediately, so you can start your import after putting up the sheet. Of course, doing the processing in the main run loop will block the application ...


I create new rows for import by calling [NSEntityDescription insertNewObjectForEntityForName:inManagedObjectContext:]. I add the object to the NSArrayController by calling addObject:.

Don't. Use only one of these methods.

The addObject: message, however, doesn't seem to be necessary for reasons I don't fully understand.

It's not necessary because you *already* added the object. NSArrayController will do the insert itself if you send it an addObject: message.


My question is -- is there any way I can turn off this update of the NSTableView until I'm done?

Yes. Remove the table view's binding to the array controller.

Sometimes, I get bad access exceptions during this update process. This makes me thing I'm doing something wrong in this multi- threaded environment.

Probably. Did you read this?

http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/ Articles/cdMultiThreading.html

My progress bar also seems to jump back and forth a bit, even though I'm steadily increasing the value passed to setDoubleValue:, and I don't change the maximum value after the import starts.

I haven't seen this problem. Show some code.


Andreas _______________________________________________ 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: Core Data: Progress bar using Sheet, modifying context in thread
      • From: Bill Coleman <email@hidden>
References: 
 >Core Data: Progress bar using Sheet, modifying context in thread (From: Bill Coleman <email@hidden>)

  • Prev by Date: Re: Core Data: Progress bar using Sheet, modifying context in thread
  • Next by Date: Re: Core Data: Progress bar using Sheet, modifying context in thread
  • Previous by thread: Re: Core Data: Progress bar using Sheet, modifying context in thread
  • Next by thread: Re: Core Data: Progress bar using Sheet, modifying context in thread
  • Index(es):
    • Date
    • Thread