2011-08-26 45 views
1

我的OCUnit目標中包含應用程序測試。我可以在應用程序主機目標中的類上調用實例方法,但我無法調用類方法。如果我把一個類的方法(如alloc),我得到下面的連接錯誤:構建iOS的OCUnit應用程序測試目標時的鏈接器錯誤

Undefined symbols for architecture armv6: 
    "_OBJC_CLASS_$_DiceGameViewController", referenced from: 
     objc-class-ref in DiceGameViewControllerTest.o 
    (maybe you meant: _OBJC_CLASS_$_DiceGameViewControllerTest) 
ld: symbol(s) not found for architecture armv6 
collect2: ld returned 1 exit status 

我想這是因爲Objective-C中並不需要在鏈接時訪問對象的文件,以實例調用,但確實需要在鏈接時訪問課堂呼叫。有人可以指我來證明這一點嗎?

這個問題是類似這樣的問題:

Imported files not recognized in OCUnit

OCUnit will not allow me to use my own data types

回答

相關問題