1

in objective c we can create our warnings.

In my case , requirement is if framework is not available i want to show my warning at the compile time.

is there any way ?

I tried

 # define BOOL isFrameworkLoaded = (NSClassFromString(@"SystemConfiguration") != nil);

  #ifdef isFrameworkLoaded  
  #else  
  #warning @"Add System Configuration Framework"  
  #endif

but getting no result.

PJR
  • 13,052
  • 13
  • 64
  • 104
  • You seem to be a little fuzzy on what you are able to do at compile time. What is your definition of "Unavailable?" If you mean unavailable to the lowest targeted version, then you can try this: http://stackoverflow.com/questions/19111934/get-xcode-5-to-warn-about-new-api-calls – borrrden Nov 06 '13 at 10:21
  • Unavailable - if i don't add framework from my target , i want to show a warning. – PJR Nov 06 '13 at 10:24
  • 1
    That is not possible. But you will get an error at compile time anyway if you don't link to the correct library and try to use it. – borrrden Nov 06 '13 at 10:25
  • A previous version of AFNetworking had this:`#ifndef __UTTYPE__ #if __IPHONE_OS_VERSION_MIN_REQUIRED #warning MobileCoreServices framework not found in project, or not included in precompiled header. etc. #else #warning CoreServices framework not found in project, etc. #endif #endif` – Larme Nov 06 '13 at 10:32
  • humm, but key for that __IPHONE_OS_VERSION_MIN_REQUIRED like isFrameworkLoaded – PJR Nov 06 '13 at 10:53

0 Answers0