On Nov 30, 2010, at 3:18 AM, Quincey Morris wrote:
> On Nov 29, 2010, at 08:10, Mikkel Eide Eriksen wrote:
> 
>> Reading up on the documentation, I guess what I should do in my Document 
>> init is this:
>> 
>> if (![self loadingWindowController])
>>      [self setLoadingWindowController:[[MyLoadingWindowController alloc] 
>> init]]; 
>> [self addWindowController:loadingWindowController]; 
> 
> Probably not. Adding the window controller to the document's window 
> controller list has side effects (such as making your window appear in the 
> Window menu, which likely isn't desirable). Your original approach seems like 
> the more natural design.

Yeah it turns out I had to jump through some hoops when I added it that way, so 
I'll probably put it back.

> Regarding your problem, you didn't by chance forget to uncheck "visible at 
> launch" in the nib file that contains your "loading" window? That could 
> produce the sort of results you're seeing.

"visible at launch" is unchecked (and the NSTextFields have "continuously 
updates value" checked).

> Alternatively, there could be a problem with the KVO compliance of your 
> document's "objectCount" property. Are you certain it's compliant?

It's defined & implemented like this so I don't think there are any compliance 
issues:

@property (readwrite, assign) NSInteger objectCount;
@synthesize objectCount;

> Alternatively, you might be reading the document contents on a background 
> thread, and therefore triggering "objectCount" KVO notifications in that 
> thread. For the user interface to work, the KVO notifications need to be 
> issued on the main thread.

I'm updating the objectCount property during readFromURL:ofType:error: - could 
that be it?

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to