“unsafeMutableAddressor:Swift.String”,引自:..“ [英] "unsafeMutableAddressor : Swift.String", referenced from:.."

查看:793
本文介绍了“unsafeMutableAddressor:Swift.String”,引自:..“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到错误:


架构x86_64的未定义符号:
DirectBistro.DBTabBarOrderedIndexesKey .unsafeMutableAddressor:Swift.String,引自:
DirectBistroUITests.TabBarControllerTests.setUp(DirectBistroUITests.TabBarControllerTests)() - > ()TabBarControllerTests.o
ld:找不到架构x86_64的符号

这是我的简单 UITest 类:

import XCTest
@testable import DirectBistro

class TabBarControllerTests: XCTestCase {

    override func setUp() {
        super.setUp()

        let defaults = NSUserDefaults.standardUserDefaults()
        defaults.setObject([], forKey: DBTabBarOrderedIndexesKey)
        defaults.synchronize()
    }
}

这是在中定义的方式DBTabBarController.swift

let DBTabBarOrderedIndexesKey = "TabBarOrderedIndexesKey"

信息窗格:

常规窗格:

推荐答案

结论是:它无法正常工作

我将其报告为错误到Apple,并得到回复:

I report it as a bug to Apple, and got a response:


UI测试与单元测试的执行方式不同 - 单元测试在应用程序进程内运行,以便他们可以访问你的申请代码。 UI测试在应用程序外部的单独进程中执行,因此可以模拟用户与应用程序交互的方式。预计您无法通过UI测试访问您的应用类。

UI tests execute differently from Unit tests - Unit tests run inside your application process so they can access your application code. UI tests execute in a separate process, outside your application, so they can simulate how the user interacts with the application. It’s not expected that you will be able to access your app class from a UI test.

这篇关于“unsafeMutableAddressor:Swift.String”,引自:..“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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