What you are trying to do is get the Union (OR) of the two sets not their intersection (AND)
use the following code should bring you all users that match either of those criterias
PFQuery *firstQuery = [PFUser query];
[firstQuery whereKey:@"username" containsString:self.searchText];
PFQuery *secondQuery = [PFUser query];
[secondQuery whereKey:@"fullName" containsString:self.searchText];
PFQuery *query = [PFQuery orQueryWithSubqueries:@[firstQuery ,secondQuery ]];
[query findObjectsInBackgroundWithBlock:^(NSArray *results, NSError *error) {
if (error) {
NSLog(@"%@ %@", error, [error userInfo]);
} else {
self.searchResults = [[NSMutableArray alloc] initWithArray:objects];
NSLog(@"%@", objects);
[self.tableView reloadData];
}
}];
and here is the link to the guide