Last active
January 3, 2016 14:36
-
-
Save tranhieutt/61aa6f973c8d61b6b9d9 to your computer and use it in GitHub Desktop.
Get Object from Class in Parse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)getGroupAccessory:(NSString *)groupAccessoryName withCompletion:(void(^)(BOOL success))completion failure:(void(^)(HondaFailureCode failureCode))failure{ | |
PFQuery *query = [PFQuery queryWithClassName:@"HondaItem"]; | |
[query whereKey:@"groupAccessary" hasPrefix:@"Điện"]; | |
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { | |
if (!error) { | |
// The find succeeded. | |
if ([self convertPFObjectToHondaDataItem:objects].count) { | |
completion([self convertPFObjectToHondaDataItem:objects]); | |
} | |
} else { | |
// Log details of the failure | |
NSLog(@"Error: %@ %@", error, [error userInfo]); | |
} | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment