title: Core data searching error (used NSString)
body: <p>I have search problem used to core data !</p>
  
  <p>-CASE 1 // It doesn't work</p>
  
  <pre><code>-(BOOL)isHeThere:(NSString*)tmpIdm{
  
      NSString *idm = [tmpIdm uppercaseString];
      NSLog(@"%@",idm);
  
      AppDelegate* appDelegate = [UIApplication sharedApplication].delegate;
      NSFetchRequest *request = [[NSFetchRequest alloc] init];
  
      NSEntityDescription *entity = [NSEntityDescription entityForName:@"HRData"
                                                inManagedObjectContext:appDelegate.managedObjectContext];
      [request setEntity:entity];
  
      NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"userIdm" ascending:NO];
      NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
      [request setSortDescriptors:sortDescriptors];
  
      NSPredicate *predicate = [NSPredicate predicateWithFormat:@"userIdm=%@",idm];
      [request setPredicate:predicate];
  
      NSError *error = nil;
      NSArray *fetchResults = [appDelegate.managedObjectContext executeFetchRequest:request
                                                                       error:&amp;error];
  
      NSLog(@"%@",fetchResults);
   // cut follow code
  }
  </code></pre>
  
  <p>LOG is</p>
  
  <pre><code>2014-04-16 15:07:25.716 MyProject[693:60b] 011204121413310F
  2014-04-16 15:07:25.734 MyProject[693:60b] (
  )
  </code></pre>
  
  <p>Result is nothing.</p>
  
  <p>but</p>
  
  <p>-Case2 // it is worked</p>
  
  <pre><code>-(BOOL)isHeThere:(NSString*)tmpIdm{
  
      NSString *idm = [tmpIdm uppercaseString];
      NSLog(@"%@",idm);
  
      AppDelegate* appDelegate = [UIApplication sharedApplication].delegate;
      NSFetchRequest *request = [[NSFetchRequest alloc] init];
  
      NSEntityDescription *entity = [NSEntityDescription entityForName:@"HRData"
                                                inManagedObjectContext:appDelegate.managedObjectContext];
      [request setEntity:entity];
  
      NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"userIdm" ascending:NO];
      NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
      [request setSortDescriptors:sortDescriptors];
  
      NSPredicate *predicate = [NSPredicate predicateWithFormat:@"userIdm=%@",@"011204121413310F"];
      [request setPredicate:predicate];
  
      NSError *error = nil;
      NSArray *fetchResults = [appDelegate.managedObjectContext executeFetchRequest:request
                                                                       error:&amp;error];
  
      NSLog(@"%@",fetchResults);
  
  // cut follow code
  ]
  </code></pre>
  
  <p>log is </p>
  
  <pre><code>2014-04-16 15:05:45.198 MyProject[681:60b] 011204121413310F
  2014-04-16 15:05:45.220 MyProject[681:60b] (
      "&lt;HRData: 0x16534d30&gt; (entity: HRData; id: 0x165381e0 &lt;x-coredata://9319373D-1532-42E0-A366-57E5B6E3EBD0/HRData/p47914&gt; ; data: &lt;fault&gt;)"
  )
  </code></pre>
  
  <p>Two case used Same code "1234F"</p>
  
  <p>Why I get Different result?</p>
  
  <p>And what's the problem?</p>
  
  <p>+I edited code back (And compile log)</p>