title: NSPredicate - Unable to generate SQL for predicate, I wonder why?
body: <p>I have already solved my problem [Blindly] without understanding root cause. But I would rather understand a concept from a professional. So could you please tell me why below identical code one works but another doesn't.</p>
  
  <p><strong>Code 1: Doesn't work</strong></p>
  
  <pre><code>//Above code omitted...
  
  NSPredicate * predicate = [NSPredicate predicateWithFormat:@"gender == m"]; //NOTICE HERE
  [request setPredicate:predicate];   
  NSError *error = nil;
  self.people = [self.managedObjectContext executeFetchRequest:request error:&amp;error];
  
   //Below code omitted...
  </code></pre>
  
  <p><strong>Code 2: Does work</strong></p>
  
  <pre><code>//Above code omitted...
  
  NSString *type = @"m";    
  NSPredicate * predicate = [NSPredicate predicateWithFormat:@"gender == %@",type]; //NOTICE HERE
  [request setPredicate:predicate];   
  NSError *error = nil;
  self.people = [self.managedObjectContext executeFetchRequest:request error:&amp;error];
  
  //Below code omitted...
  </code></pre>
  
  <p><hr />
  Forgot to tell about what error I got, I got SIGABRT on below line, When I executed Code 1.</p>
  
  <pre><code> self.people = [self.managedObjectContext executeFetchRequest:request error:&amp;error];
  </code></pre>
  
  <p>And one more thing, in GCC error was it cannot format predicate because of "gender == m".</p>
  
  <p><hr />
  Enlighten me!!</p>
  
  <p>Thanks</p>