Skip to content

Instantly share code, notes, and snippets.

@pratikshabhisikar
Created February 28, 2012 11:26
Show Gist options
  • Save pratikshabhisikar/1932018 to your computer and use it in GitHub Desktop.
Save pratikshabhisikar/1932018 to your computer and use it in GitHub Desktop.
Fetch Google Places
[googlePlaces fetchWithCompletionHandler:^(NSMutableSet *fetchedPlaces, NSError *error){
if (fetchedPlaces) {
places = [[NSMutableArray alloc] initWithArray:[fetchedPlaces allObjects]];
[self.tableView reloadData];
}else {
if (error) {
// Optionally display error here.
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Sorry" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
}
}
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment