title: Compare UITextField with PFQuery of parse.com
body: <p>I have a small problem .. I hope you can help me ...
  In my app I'm using Parse.com for data management.</p>
  
  <p>I have a ViewController that contains a TextField called "Email".
  With a query parse.com call all the registered user app and their email. Now I would like to try to compare the values of the textField and those of the query .. Let me give an example ..</p>
  
  <p>The user enters their email in the textField but if this email is already present in the archive of the users (of course taken by the query parse.com) shows an alert that warns him that the Supplied in textField is already existing in parse.com.</p>
  
  <p>I tried to do this but it does not always recognize the email in query..dove am I doing wrong?</p>
  
  <blockquote>
    <p>P.S. the textField is not in viewController Main but is in another
    ViewController called generalData.</p>
  </blockquote>
  
  <pre><code>-(void)query {
      PFQuery *totalUser = [PFUser query];
      [totalUser findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
  
          if (!error) {
  
              for (PFObject *object in objects) {
                  [array addObject:object];
                  NSLog(@"%@", [object objectForKey:NPUserKey_EMAIL]);
  
                  // NSStrings
                  email = generalData.emailTextField.text;
                  compareEmail = [object objectForKey:NPUserKey_EMAIL];
              }
  
          }
      }];
  }
  
  
  
  - (IBAction)presentNextViewController:(id)sender {
  
                  if ([generalData.emailTextField.text isEqualToString:compareEmail]) {
  
                      NSString *stringError = [NSString stringWithFormat:@"L'email %@ è gia presente nei nostri archivi.",email];
                      NPUMessageView *alertMessage;
                      alertMessage= [[NPUMessageView alloc] showViewWithMessage:stringError withBackgroundColor:SECONDARY_COLOR];
                      [self.view addSubview:alertMessage];
                      [alertMessage showAnimatedView];
  
                      NSLog(@"email found in archive");
  
                  }
  
                  else {
  
                      NSInteger index = [controllersContainer indexOfObject:self.destinationViewController];
                      index = MIN(index+1, [controllersContainer count]-1);
  
                      [self presentCurrentViewController:self.currentViewController withPage:index];
                  }
  
  }
  </code></pre>