开发者

NSWorkspace openFile: randomly brings focus back to my app

Within my Cocoa app, I call NSWorkspace's openFile: method to open some file with its default application.

Sometimes this works just fine, and the other application gets focus, as it should.

开发者_JAVA百科

But alas, sometimes (the occurrence of which seems to be totally random), after the focus goes briefly to the other application, it goes quickly back to my Cocoa app. This is unwanted.

Any ideas what the causes could be?

Note: I have also tried the openFile:withApplication:andDeactivate:, passing YES to the last argument. This doesn't work either. The strange random occurrences of focus going back to my Cocoa app persist.


I'm unable to reproduce this now. Not sure what the problem was.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜