Re: Problem with NSDatePicker in popover
Re: Problem with NSDatePicker in popover
- Subject: Re: Problem with NSDatePicker in popover
- From: Graham Cox <email@hidden>
- Date: Sun, 24 Feb 2013 22:33:17 +1100
On 24/02/2013, at 10:16 PM, Bill Cheeseman <email@hidden> wrote:
> I assume that the change in window is the source of the problem with the date picker's highlighting behavior after the popover is detached. But I don't understand exactly what's happening, or what I can do about it.
>
Well, I haven't tried this thing with detaching a popover window, but looking at the docs there are a few things that you haven't mentioned. For example, the docs take pains to point out not to attempt to move the content from the popover to the window, but instead to create a separate nib with the content for the detached window. (I think you could probably share a nib loaded by a NSViewController, but it would still be instantiated separately).
I assume you have followed this advice.
In that second nib, it doesn't seem as if there should be anything special about the arrangement of the window and its content, so it should behave just as if it were any other window loaded from a nib. That means if you have set initialFirstResponder to the date picker view in this second nib, it will become first responder (and hence highlight) when the window is shown. Alternatively, if you are loading the window content using a NSViewController, you might have to undertake setting the initial first responder yourself.
If you've done all that and it's still not working as expected, maybe there's a subtle bug in the code that animates between the popover and the new window. This being newish code, it's possible.
I have frequently found that Apple's own sample code isn't always as thorough as it could be, so just using sample code as boilerplate may not have considered all these issues; it might not be a bug but just something the sample code didn't bother with.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden