【问题标题】:Array initialization is causing build to fail - arrayForceCastU数组初始化导致构建失败 - arrayForceCastU
【发布时间】:2014-09-08 02:20:38
【问题描述】:

这行代码阻止了我的项目的构建:

var allAttributes: [UICollectionViewLayoutAttributes] = []

我尝试了var allAttributes = [UICollectionViewLayoutAttributes](),但它也无法构建。

以下是错误详情:

Apple Mach-O Linker Error:
Undefined symbols for architecture i386:
"__TFSs15_arrayForceCastU___FGSaQ__GSaQ0__", referenced from: __TFC42com_myname...30ClassWhereCodeIs33layoutAttributesForElementsInRectfS0_FVSC6CGRectGSqGSaPSs9AnyObject___ in ClassWhereCodeIs.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

初始化数组以便我可以附加对象来填充它的正确方法是什么?

【问题讨论】:

    标签: ios arrays swift initialization


    【解决方案1】:

    第一行在视图控制器类中对我来说很好。

    您是否尝试过删除派生数据?

    窗口菜单 > 管理器 -> 项目 -> 选择项目。右侧有一个删除派生数据的按钮。

    【讨论】:

    • 嗯,成功了。我还重置了模拟器并退出/重新打开了 Xcode。很奇怪。
    猜你喜欢
    • 1970-01-01
    • 2014-12-15
    • 1970-01-01
    • 2015-04-19
    • 2016-04-08
    • 1970-01-01
    • 2019-09-21
    • 1970-01-01
    • 2019-10-17
    相关资源
    最近更新 更多