title: IOS & Objective C - how can i resolve this error "implicit declaration of function "class_getname " is invalid in c99"?
body: <p>Actually there are two errors, the first one is :
  "implicit declaration of function "class_getname " is invalid in c99"</p>
  
  <p>The second one is : 
  incompatible integer to pointer conversion initializing 'const char*' with an expression of type 'int'</p>
  
  <p>my method is :</p>
  
  <pre><code>-(void) donneesrecoltees:(NSData *)donnees {
      NSError *erreur;
      NSNumber *lastMessage,*currentMessage;
  
  
      //int i;
      NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
      NSString *msg;
  
      UIAlertView *alert;
  
      NSDictionary *json=[NSJSONSerialization JSONObjectWithData:donnees options:0 error:&amp;erreur];
      // Check if it's the right class to avoid error stack
  
      // this is the line that is causing the error
      const char* className = class_getName([json class]);
  
      NSString *myClass=[NSString stringWithFormat:@"%s",className];
  
  ....
  
  }
  </code></pre>
  
  <p>Any help on how to fix this? thank you</p>