Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking for Presence of Objective-C Framework

I am creating a framework right now that can work with CoreData if you would like. The framework has functionality outside of CoreData as well. How can I wrap all the CoreData specific code in IfDef's, checking if the CoreData framework is available?

like image 389
cruffenach Avatar asked Jul 20 '11 17:07

cruffenach


1 Answers

What you will want to do is use a weak link to the CoreData foundation. Once you do that you can use runtime checks to make sure that CoreData is available. Constant variables can be checked for existence at runtime as well. If you were to use preprocessor (#if #ifdef) checks you would then have two separate framework versions to distribute with each release.

like image 178
Joe Avatar answered Nov 15 '22 23:11

Joe