基于文档的应用程序与情节提要板一起自动保存 [英] Document-Based App autosave with storyboards

查看:86
本文介绍了基于文档的应用程序与情节提要板一起自动保存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在基于文档的应用程序中,使用XIB文件创建新窗口时,其行为是:

In Document-Based Apps, using XIB files, when a new window is created its behaviour is:

  1. 根据最后一个活动对象的位置进行定位和确定大小窗户.
  2. 如果最后一个活动窗口仍然可见,则新窗口窗口应该是级联的,这样就不会直接重叠.

但是,使用情节提要板时,此操作没有完成.参见测试项目.

However when using a storyboard this isn't done. See test project.

推荐答案

您可以在情节提要的窗口控制器上设置shouldCascadeWindows:

You can set shouldCascadeWindows on the window controller in your storyboard:

  1. 在情节提要中选择窗口控制器
  2. 选择身份检查器
  3. 使用以下值添加新的用户定义的运行时属性:

  • 密钥路径:shouldCascadeWindows
  • 类型:布尔值
  • 值:已选中
  • 更新:如果移动第一个窗口,则新窗口将从屏幕中间而不是第一个窗口开始级联.要解决它:

    Update: If you move the first window, new windows cascade starting in the middle of the screen not under the first window. To fix it:

    1. 选择窗口
    2. 在属性检查器中为其指定一个自动保存的名称

    这还将在下次加载窗口和启动应用程序时保留窗口的位置和大小.

    This should also persist window location and size on the next window load and application launch.

    这篇关于基于文档的应用程序与情节提要板一起自动保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆