2015-08-17 13 views
6

ho ottenuto un errore:"unsafeMutableAddressor: Swift.String", si fa riferimento da: .."

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

Questa è la mia semplice UITest classe:

import XCTest 
@testable import DirectBistro 

class TabBarControllerTests: XCTestCase { 

    override func setUp() { 
     super.setUp() 

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

Questo è come è definito in DBTabBarController.swift:

let DBTabBarOrderedIndexesKey = "TabBarOrderedIndexesKey" 

Info riquadro:

enter image description here

Generale riquadro:

enter image description here

+0

Hai impostato l'applicazione host per i test in modo corretto? – Shripada

+0

App host per test? Come fare questo? –

+1

Vai alle impostazioni di destinazione, seleziona il target di prova> Info – Shripada

risposta

5

Il conslusion è: non è andare a lavorare.

ho segnalarlo come un bug ad Apple, e ha ottenuto una risposta:

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.

Problemi correlati