Apple Mach-O Linker Error using Core Data classes in OCUnit

前端 未结 3 1830
不思量自难忘°
不思量自难忘° 2021-01-18 17:12

OK, here\'s my code in my test class:

 - (NSManagedObjectContext*)managedObjectContextWithConcurrencyType:(NSManagedObjectContextConcurrencyType)concurrencyT         


        
相关标签:
3条回答
  • 2021-01-18 17:53

    You probably haven't linked the library to the target.

    enter image description here

    Taken from: http://yannickloriot.com/wp-content/uploads/2012/03/Link-CoreData-Framework-To-The-Project.png

    0 讨论(0)
  • 2021-01-18 18:12

    Changing 'No Common Blocks' from Yes to No (under Targets->Build Settings->Apple LLVM - Code Generation) fixed the problem. This fixed my problem. Hope it will help to you.

    0 讨论(0)
  • 2021-01-18 18:17

    In my experience i386 errors tend to come from missing libraries. Its not enough to just #import them in your file, you must also add them to the project libraries. Go into the Project Target -> Build Phases -> Link Binary with Libraries and in your case add the libraries associated with Core Data.

    0 讨论(0)
提交回复
热议问题