Re: Core Data: Progress bar using Sheet, modifying context in thread
Re: Core Data: Progress bar using Sheet, modifying context in thread
- Subject: Re: Core Data: Progress bar using Sheet, modifying context in thread
- From: Bill Coleman <email@hidden>
- Date: Fri, 4 Aug 2006 23:02:14 -0400
On Aug 4, 2006, at 8:52 PM, Jakob Olesen wrote:
Ugh! I did this for years under MacOS 9....
Yeah, well. Did you get random exceptions back then? :-)
No, I had to use Windows for that....
There is no free lunch when doing multiprocessing. You can use a
thread and deal with the issues, or you can use cooperative
multitasking and deal with some other issues.
OK, got it.
Generally, the single-threaded option is easier. Especially when
Core Data is involved.
I can see that, but other posters indicate that if I really want the
document-modal behavior, I have to use threads.
[progressBar performSelectorOnMainThread:@selector(setDoubleValue:)
withObject:[NSNumber mumble] waitUntilDone:NO];
You can't call -[setDoubleValue:] like that since it takes a double
argument, not an object. The result is a double composed of 32 bits
of pointer and 32 bits of garbage.
No NSNumber. In fact, I was passing an int, which appears to be
correctly promoted to a double when called directly.
But I see what you mean. The argument has to be an object. Subtle.
Thanks.
Bill Coleman, AA4LR, PP-ASEL Mail: email@hidden
Quote: "We invented personal computing."
-- Bill Gates @ TechNet / MSDN 2003
_______________________________________________
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