I've a method triggered when a NSTextField looses focus. This method displays a popup sheet over my current window.
Everything works great except when I've typed something in the text field and successively I close the window by clicking on the close button. In this case:
but
Thanks
您应该创建一个NSWindowDelegate
并实现-windowShouldClose:
如果弹出窗口可见或者文本字段是先前的第一响应者(否则,您正在确定文本字段失去了焦点),则返回NO
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.