5

我正在使用 Xcode 7.0 beta 4,最近将我的单个 Main.storyboard 拆分为一系列由故事板引用连接的故事板(Xcode 7 中新提供)。

构建时,我收到以下“Interface Builder Storyboard Linker Error”:

/* com.apple.ibtool.errors */
: error: The file “Info.plist” couldn’t be saved in the folder “Pages.storyboardc”.
    Underlying Errors:
        Description: The operation couldn’t be completed. Not a directory
        Failure Reason: Not a directory

我怎样才能理解这个错误?


故事板引用是通过选择原始故事板中的场景并选择Editor > Refactor to Storyboard... 来创建的。我之前遇到的一个问题是情节提要链接器抛出了不同类型的错误:

/* com.apple.ibtool.errors */
: error: Deploying Storyboard References to iOS 8.0 requires that your storyboards do not
         share any view controller identifiers. Browser.storyboard and Pages.storyboard
         both contain a view controller with identifier "PagesViewController".

事实证明,使用“重构到情节提要...”命令已根据重构的视图控制器标识符之一自动将情节提要 ID 分配给情节提要引用。这导致了错误描述的情况(故事板引用与视图控制器场景的标识符具有相同的标识符)。我删除了这些标识符,因为我认为您不需要从代码中引用情节提要。


更新:

我也看到这个问题表现为一个稍微不同的错误:

/* com.apple.ibtool.errors */
: error: “<StoryboardReferenceID>.nib” couldn’t be removed.
    Underlying Errors:
        Description: The operation couldn’t be completed. Not a directory
        Failure Reason: Not a directory
4

1 回答 1

3

在写这个问题时,我找到了一种摆脱错误的方法。但是,我不能说我对这意味着什么更明智,因此欢迎任何其他见解。

I re-added the storyboard IDs I had removed to avoid the previous error relating to view controllers sharing the same identifier, but made sure no two were the same. The error no longer shows.

I don't know what the implications of a storyboard identifier are for a storyboard reference, but it seems that the linker would prefer them to have one! I would have expected a compiler warning/error instead of a linker error if an identifier is required (like when a scene is inaccessible due to a lack of identifier), so I'm currently thinking this is a linker bug that might be ironed out by the final release of Xcode 7.

于 2015-08-08T15:00:31.520 回答