ios - Simple Parse.com with findObjectsInBackgroundWithBlock does not return -
i trying query _user class parse use on tableviewcell. getting nil value it. did have working @ 1 time simpler, not recommended, query:
working query (not recommended):
- (nsarray *)loadusers { pfquery *users = [pfuser query]; return [users findobjects];}
not working query:
- (void)loadalluser:(void (^)(bool completion))completion { pfquery *query = [pfuser query]; __block nsarray *loadusers = [nsarray new]; [query findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error) { if (!error) { (user *user in objects) { loadusers = [loadusers arraybyaddingobject:user]; } [taskcontroller sharedinstance].loadalluser = loadusers; }else { nslog(@"error: %@ %@", error, [error userinfo]); } }];
}
i subclassing _user class parse (just fyi)
the problem when method called. numberofrowsinsection not passing nil value.