Skip to content

Instantly share code, notes, and snippets.

@emilepetrone
Created October 11, 2011 17:33
Show Gist options
  • Save emilepetrone/1278777 to your computer and use it in GitHub Desktop.
Save emilepetrone/1278777 to your computer and use it in GitHub Desktop.
// find ten records in a given area
SGEnvelope *envelope = [SGEnvelope envelopeWithNorth:40.613952
west:-105.90271
south:39.078908
east:-103.513184];
SGStorageQuery *query = [SGStorageQuery queryWithEnvelope:envelope
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