Q:

Compare UITextField with PFQuery of parse.com

I have a small problem .. I hope you can help me ...
In my app I'm using Parse.com for data management.
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 ..
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.
I tried to do this but it does not always recognize the email in query..dove am I doing wrong?

P.S. the textField is not in viewController Main but is in another
  ViewController called generalData.

-(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];
                }

}

A:

I think you are getting ahead of yourself a little bit. Parse automatically checks for duplicate emails when you try to sign up a new user. Let the user enter their email into the field, and when they try to create the account, display the error Parse returns from the signup method, and let them try again!
https://www.parse.com/docs/ios_guide#users-signup/iOS

