我遇到了一組神祕鏈接器錯誤。我的常規目標和UITest目標生成並執行正常,但UnitTest目標總是失敗,並顯示下面的錯誤。似乎是CoreData的一些問題,但我不明白爲什麼它在測試目標上的錯誤,而不是在主要目標上。我試過了: 1)清除導出的數據。 2)重新啓動xCode 3)乾淨的安裝莢Xcode 8 UITests「直接字段偏移」的構建錯誤
任何有關在哪裏尋找問題的幫助將不勝感激。我很難過。謝謝!
Undefined symbols for architecture x86_64:
"direct field offset for playolaIphone.AppDelegate.(managedObjectModel.storage in _D550B33DB84959D9A74FD87E48EB7BC7) : __ObjC.NSManagedObjectModel?", referenced from:
playolaIphone.AppDelegate.managedObjectModel.setter : __ObjC.NSManagedObjectModel in MockAppDelegate.o
playolaIphone.AppDelegate.(managedObjectModel.materializeForSet : __ObjC.NSManagedObjectModel).(closure #1) in MockAppDelegate.o
"direct field offset for playolaIphone.AppDelegate.(managedObjectContext.storage in _D550B33DB84959D9A74FD87E48EB7BC7) : __ObjC.NSManagedObjectContext?", referenced from:
playolaIphone.AppDelegate.managedObjectContext.setter : __ObjC.NSManagedObjectContext in MockAppDelegate.o
playolaIphone.AppDelegate.(managedObjectContext.materializeForSet : __ObjC.NSManagedObjectContext).(closure #1) in MockAppDelegate.o
"direct field offset for playolaIphone.AppDelegate.(persistentStoreCoordinator.storage in _D550B33DB84959D9A74FD87E48EB7BC7) : __ObjC.NSPersistentStoreCoordinator?", referenced from:
playolaIphone.AppDelegate.persistentStoreCoordinator.setter : __ObjC.NSPersistentStoreCoordinator in MockAppDelegate.o
playolaIphone.AppDelegate.(persistentStoreCoordinator.materializeForSet : __ObjC.NSPersistentStoreCoordinator).(closure #1) in MockAppDelegate.o
"direct field offset for playolaIphone.AppDelegate.(applicationDocumentsDirectory.storage in _D550B33DB84959D9A74FD87E48EB7BC7) : Foundation.URL?", referenced from:
playolaIphone.AppDelegate.applicationDocumentsDirectory.setter : Foundation.URL in MockAppDelegate.o
playolaIphone.AppDelegate.(applicationDocumentsDirectory.materializeForSet : Foundation.URL).(closure #1) in MockAppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
嘗試:http://stackoverflow.com/questions/9458739/ld-warning-directory-not-found-for-option – shallowThought