• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSWindow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindow


  • Subject: Re: NSWindow
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 30 Nov 2015 14:35:37 -0800
  • Feedback-id: 167118m:167118agrif8a:167118sUcNe2R7sp:SMTPCORP

On Nov 30, 2015, at 10:23 , Jerry Krinock <email@hidden> wrote:
>
> Did I miss the announcement of this rather major change?

I don’t think so, I think you are Doing It Wrong™. ;)

I’m not aware that the APIs you mention in 1 and 2 have any known contract about when they have their effect. It could be synchronous or asynchronous, and it could be now or later.

1. Sending ‘display’ is likely a code smell anyway.

2. It’s always been true that the panel is still displayed during its completion handler. The correct approach has always been to retrieve the result URL(s) you want, then orderOut: the panel before doing something else in the completion handler, unless the block is so short it doesn’t matter. (The system dismisses the sheet after you return, if you haven’t done it already.)

But in both cases, what you’re really doing wrong is blocking the main thread. It’s never been a good idea, and OS X is becoming less and less tolerant of your doing that, especially now that there are easy ways to get around it. In both 1 and 2, you should be able to dispatch_async "some task of noticeable duration” on a background queue, which (at its end) dispatch_async’s anything it needs to do on the main thread with an internal dispatch_async to the main queue. It’s a bit ugly in Obj-C because your source code is at least 3 levels deep in horrible block syntax, but it’s perfectly straightforward, unless you have larger thread safety issues you don’t want to face.

I’m not sure that 3 has anything to do with windows or synchronicity. I think it’s more about changes in the way CALayers behave**. When I restart my elderly iMac 27”, I frequently see black Finder windows during the time that iTunes starting up seems to put a stranglehold on the system.

Regarding Richard’s 4, what’s changed about zooming is that the green button means something different now. Presumably that has side effects on the delegate method, because the window is probably trying to go full-screen — which is why the menu bar dimensions might be involved. (It may also be broken in 10.11, but I’m not surprised it’s different.)


** Or possibly places where CALayers are involved now, but they didn’t use to be.

_______________________________________________

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


  • Follow-Ups:
    • Re: NSWindow displaying asynchronously starting in 10.11
      • From: Jerry Krinock <email@hidden>
References: 
 >NSWindow (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Self and associated type requirements (yes again!)
  • Next by Date: Re: NSWindow
  • Previous by thread: Re: NSWindow
  • Next by thread: Re: NSWindow displaying asynchronously starting in 10.11
  • Index(es):
    • Date
    • Thread