Skip to content

Instantly share code, notes, and snippets.

@emilepetrone
Created October 11, 2011 17:32
Show Gist options
  • Save emilepetrone/1278770 to your computer and use it in GitHub Desktop.
Save emilepetrone/1278770 to your computer and use it in GitHub Desktop.
// get records near a point
SGStorageQuery *query = [SGStorageQuery queryWithPoint:[SGPoint pointWithLat:37.772445 lon:-122.405913]
layer:@"com.simplegeo.example"];
[client getRecordsForQuery:query
callback:[SGCallback callbackWithSuccessBlock:
^(id response) {
// you've got records!
// to create an array of SGStoredRecord objects...
NSArray *records = [NSArray arrayWithSGCollection:response
type:SGCollectionTypeRecords];
} failureBlock:^(NSError *error) {
// handle failure
}]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment