views:

31

answers:

1

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
I need to test at compile time not run time.
Riq Hopkins
why do you need it at compile time?
willcodejavaforfood