Re: NSTextField not updated during large process

2012-10-17 Thread Mikevann
Make sure your main thread is not busy, stuck waiting in a lock, or in a modal loop. If it is many outside messages to the main thread and most UI updating will be queued up until the main thread is free again. If this is the case, then it's not surprising NSProgressIndicator updates as it is

Re: NSTextField not updated during large process

2012-10-14 Thread Mike Abdullah
On 12 Oct 2012, at 23:55, Koen van der Drift koenvanderdr...@gmail.com wrote: Man, I thought I had this all working, and after a few days of doing other stuff, it is back to my original issue. I am now updating my textfield as follows, so no matter from where it is called, it will always

Re: NSTextField not updated during large process

2012-10-14 Thread Koen van der Drift
On Oct 14, 2012, at 3:04 PM, Mike Abdullah cocoa...@mikeabdullah.net wrote: How did you determine that -updateStatusWrapper: doesn't get called? (You could do away with that method entirely BTW, and just use setProgressStatus: as the selector) You're updating a property of self. How

Re: NSTextField not updated during large process

2012-10-14 Thread Kyle Sluder
On Sun, Oct 14, 2012, at 12:29 PM, Koen van der Drift wrote: Even if I use: - (void)updateStatus: (NSString *)status { [statusTextField performSelectorOnMainThread:@selector( setStringValue:) withObject: status waitUntilDone: NO]; // or YES } the field does not get updated.

Re: NSTextField not updated during large process

2012-10-14 Thread Koen van der Drift
On Oct 14, 2012, at 4:34 PM, Kyle Sluder k...@ksluder.com wrote: Okay, at this point you need to step back a bit and actually work through your threading architecture. The first question to ask yourself is whether you actually understand multithreading. The second question to ask is whether

Re: NSTextField not updated during large process

2012-10-14 Thread Mike Abdullah
On 14 Oct 2012, at 20:29, Koen van der Drift koenvanderdr...@gmail.com wrote: On Oct 14, 2012, at 3:04 PM, Mike Abdullah cocoa...@mikeabdullah.net wrote: How did you determine that -updateStatusWrapper: doesn't get called? (You could do away with that method entirely BTW, and just use

Re: NSTextField not updated during large process

2012-10-14 Thread Koen van der Drift
On Oct 14, 2012, at 4:47 PM, Mike Abdullah cocoa...@mikeabdullah.net wrote: Presumably statisTextField is an outlet? Sure you've got it hooked up right? Yup, it is an outlet and hooked up. SInce it is being updated during the download phase of the process, I can assume it is connected

Re: NSTextField not updated during large process

2012-10-14 Thread Koen van der Drift
Interestingly, I also have a progressbar, and that one gets updated as expected in all cases. Very strange. - Koen. On Oct 14, 2012, at 4:54 PM, Koen van der Drift koenvanderdr...@gmail.com wrote: On Oct 14, 2012, at 4:47 PM, Mike Abdullah cocoa...@mikeabdullah.net wrote: Presumably

Re: NSTextField not updated during large process

2012-10-12 Thread Koen van der Drift
Man, I thought I had this all working, and after a few days of doing other stuff, it is back to my original issue. I am now updating my textfield as follows, so no matter from where it is called, it will always be updated on the main thread: - (void)updateStatus: (NSString *)status {

Re: NSTextField not updated during large process

2012-10-01 Thread Koen van der Drift
On Sun, Sep 30, 2012 at 7:20 PM, Koen van der Drift koenvanderdr...@gmail.com wrote: On Sep 30, 2012, at 6:51 PM, Ken Thomases k...@codeweavers.com wrote: Move the long-running operation to a background thread (e.g. using -performSelectorInBackground:withObject:, or dispatch_async() to a

Re: NSTextField not updated during large process

2012-10-01 Thread Koen van der Drift
On Oct 1, 2012, at 8:59 AM, Koen van der Drift koenvanderdr...@gmail.com wrote: Ok, I decided to use NSOperation(Queue) as it is generally recommended over performSelectorXXX to be a more modern API, and have been reading a bit about it. In Hillegass' Cocoa book, he uses processQueue

Re: NSTextField not updated during large process

2012-10-01 Thread Koen van der Drift
On Oct 1, 2012, at 5:39 PM, Koen van der Drift koenvanderdr...@gmail.com wrote: [myQueue addOperationWithBlock:^(void) { [self parseData]; // calculate the new data and update the model }]; // now tell everyone we're done [self finishedTask]; //

Re: NSTextField not updated during large process

2012-10-01 Thread Mike Abdullah
On 1 Oct 2012, at 22:39, Koen van der Drift koenvanderdr...@gmail.com wrote: On Oct 1, 2012, at 8:59 AM, Koen van der Drift koenvanderdr...@gmail.com wrote: Ok, I decided to use NSOperation(Queue) as it is generally recommended over performSelectorXXX to be a more modern API, and have

Re: NSTextField not updated during large process

2012-10-01 Thread Koen van der Drift
On Oct 1, 2012, at 6:31 PM, Mike Abdullah cocoa...@mikeabdullah.net wrote: Yes, you don't understand the consequences of your code yet. AppKit is not threadsafe. You absolutely MUST only update UI on the main thread for something like this. Make sure your -parseData routine is

NSTextField not updated during large process

2012-09-30 Thread Koen van der Drift
I am downloading and parsing a large file from a database, and to keep the user informed, I have a NSTextField where I display the status. The field is bound to an NSString (progressStatus), and the controller has the following method to update it: -(void)updateStatus: (NSString *) status {

Re: NSTextField not updated during large process

2012-09-30 Thread Ken Thomases
On Sep 30, 2012, at 5:26 PM, Koen van der Drift wrote: I am downloading and parsing a large file from a database, and to keep the user informed, I have a NSTextField where I display the status. The field is bound to an NSString (progressStatus), and the controller has the following method

Re: NSTextField not updated during large process

2012-09-30 Thread Koen van der Drift
On Sep 30, 2012, at 6:51 PM, Ken Thomases k...@codeweavers.com wrote: Move the long-running operation to a background thread (e.g. using -performSelectorInBackground:withObject:, or dispatch_async() to a non-main queue, or NSOperation and NSOperationQueue, etc.). However, all updates to