title: Incompatible pointer type sending 'Class' to parameter of type 'NSDate *'
body: <p>I have an NSDate category with following method</p>
  
  <pre><code>@implementation NSDate (DateUtility)
  
  +(NSString *)dateTimeStringForDB {
      NSDateFormatter *dateFormatForDB = [[NSDateFormatter alloc] init];
      [dateFormatForDB setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
      NSString *aDateStr= [dateFormatForDB stringFromDate:self];
      [dateFormatForDB release];
      return aDateStr;    
  }
  @end
  </code></pre>
  
  <p>with this definition I receive a warning .</p>
  
  <p><strong>Incompatible pointer type sending 'Class' to parameter of type 'NSDate *'</strong></p>
  
  <p>However type casting self  before assign it as argument suppresses this warning.</p>
  
  <pre><code>+(NSString *)dateTimeStringForDB
  {
      NSDateFormatter *dateFormatForDB = [[NSDateFormatter alloc] init];
      [dateFormatForDB setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
      NSString *aDateStr= [dateFormatForDB stringFromDate:(NSDate*)self];
      [dateFormatForDB release];
      return aDateStr;    
  }
  </code></pre>
  
  <p>Can we really not pass self as an argument in a category without typecasting it ?  What is this feature dependent on  , the compiler ? Looking for an answer before actually posting it as a question on SO I came across <a href="https://stackoverflow.com/a/5905567/438658">this</a>, however I am still not clear as to what goes behind the scene.</p>