2015-08-17 7 views
6

bekam ich einen Fehler:"unsafeMutableAddressor: Swift.String", verwiesen von: ..“

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

Dies ist meine einfache UITest Klasse:

import XCTest 
@testable import DirectBistro 

class TabBarControllerTests: XCTestCase { 

    override func setUp() { 
     super.setUp() 

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

Dies ist, wie es definiert ist in DBTabBarController.swift:

let DBTabBarOrderedIndexesKey = "TabBarOrderedIndexesKey" 

Info Bereich:

enter image description here

Allgemeine Bereich:

enter image description here

+0

Haben Sie den Host-App für Ihre Tests richtig eingestellt? – Shripada

+0

Host-App für Tests? Wie macht man das? –

+1

Gehe zu deinen Zieleinstellungen, wähle das Testziel> Info – Shripada

Antwort

5

Die conslusion ist: es geht nicht zu arbeiten.

berichte ich es als einen Fehler an Apple, und bekam eine Antwort:

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.

Verwandte Themen