title: How to fetch a single object from Coredata using a predicate
body: <p>I am trying to fetch a single object from my coredatabase, however it keeps returning null. My method is based off another method which returns every value from the coredata object that I am accessing.. </p>
  
  <p>I have never tried this before and have tried reading apples documents but its just not making sense.. this is what my method looks like</p>
  
  <pre><code>- (NSMutableArray *)readSelectedInstall:(NSString *)projIDString {
      NSManagedObjectContext *context = [self managedObjectContext];
  
      if (context == nil) {
          NSLog(@"Nil");
      }
      else {
  
  
          NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
          NSEntityDescription *entity = [NSEntityDescription entityForName:@"InstallProject" inManagedObjectContext:context];
          [fetchRequest setEntity:entity];
  
          NSPredicate *predicate = [NSPredicate predicateWithFormat:@"ProjID==%@", projIDString];
          [fetchRequest setPredicate:predicate];
  
          NSError *error;
  
          NSMutableArray *installProjectDictionaryArray = [[NSMutableArray alloc] init];
  
  
          NSArray *fetchedObjects = [context executeFetchRequest:fetchRequest error:&amp;error];
          for (InstallProject *installProj in fetchedObjects) {
  
              NSMutableDictionary *tempInstallProjectDictionaryArray = [[ NSMutableDictionary alloc] init];
  
              [tempInstallProjectDictionaryArray setObject:installProj.companyName forKey:@"CompanyName"];
              [tempInstallProjectDictionaryArray setObject:installProj.projNo forKey:@"ProjNo"];
              [tempInstallProjectDictionaryArray setObject:installProj.projID forKey:@"ProjID"];
  
              [installProjectDictionaryArray addObject:tempInstallProjectDictionaryArray];
          }
  
          return installProjectDictionaryArray;
      }
      return nil;
  }
  </code></pre>
  
  <p>any help getting me to return a single item thats projID matches the projIDString would be greatly appreciated.</p>