"unsafeMutableAddressor: Swift.String" referenced: .. "

There was an error:

Undefined symbols for architecture x86_64: "DirectBistro.DBTabBarOrderedIndexesKey.unsafeMutableAddressor : Swift.String", referenced from: DirectBistroUITests.TabBarControllerTests.setUp (DirectBistroUITests.TabBarControllerTests)() -> () in TabBarControllerTests.o ld: symbol(s) not found for architecture x86_64

This is my simple UITest class:

 import XCTest @testable import DirectBistro class TabBarControllerTests: XCTestCase { override func setUp() { super.setUp() let defaults = NSUserDefaults.standardUserDefaults() defaults.setObject([], forKey: DBTabBarOrderedIndexesKey) defaults.synchronize() } } 

Here is how it is defined in DBTabBarController.swift :

 let DBTabBarOrderedIndexesKey = "TabBarOrderedIndexesKey" 

Information :

enter image description here

General area :

enter image description here

+6
source share
1 answer

Conclusion: it will not work .

I report this as an error for Apple and received the answer:

User interface tests run differently than unit tests. Unit tests are performed inside your application process so that they can access your application code. User interface tests are performed in a separate process outside of your application so that they can simulate user interaction with the application. You are not expected to be able to access your application class from a user interface test.

+5
source

All Articles