On Mar 8, 2009, at 2:20 PM, Luke Evans wrote:

IIRC, NSObjectController, as a super class has some behavior that doesn't make sense to an NSObjectControlelr proper. Because of this it is possible that the selection change has been deferred to the run loop. You can manually run the run loop to see if this is the case.

It seems to me that there is no need for you to use - selectedObjects when there will always be a 1:1 relationship between the controller content and the selected object.


Yes, naturally if I change my selection code to just look at the content then indeed everything works fine. However, see below... I'm not sure about the run loop thing. Although I haven't tried this in my test app yet, the behaviour in the main app seems to suggest that changing the content object never updates the selectedObjects array, except perhaps for the very first time.


After setting the content, but before you check selectedObjects, run:

        [[NSRunLoop currentRunLoop] runUntilDate:[NSDate date]];

If that works, then you have the runloop issue. Otherwise, it is probably a bug and I would file a radar.

Just know that there may be caveats to forcing the runloop like this, so caveat programmor.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to