I have a class that I need to use in both Core Data and non Core Data applications. In non Core Data applications I need the class to omit certain code at compile time. Are there any compiler directives that detect if Core Data framework is added to the Xcode project, something like #ifdef __COREDATA?
A:
You could just test for a class and see if it's defined.
if ([NSFetchRequest class] == nil)
joelm
2010-08-06 14:23:51
I need to test at compile time not run time.
Riq Hopkins
2010-08-06 17:01:01
why do you need it at compile time?
willcodejavaforfood
2010-10-19 12:44:54