SGLocationServiceDelegate |
Recieves notifications when SGLocationService returns from sending an HTTP request.
Extends Protocol: NSObject
Declared In: SGLocationService.h
This is a simple delegate that allows notifications for when a request to SimpleGeo's API succeeds or fails. In the case that a request succeeds a responseObject is returned. The responseObject can take on the identity of either NSDictionary or NSArray.
If the responseObject is of type NSDictionary, then the dictoinary is the GeoJSON representation of the of a record. If the responseObject is of type NSArray, then each element within the array will be a dictionary that is aGeoJSON representation of a record. See SGGeoJSONEncoder for a specific guide to the GeoJSON objects that returned from SimpleGeo.
In the case that an HTTP request fails, this method is called.
In the case that an HTTP request succeeds, this method is called.
locationService:failedForResponseId:error: |
In the case that an HTTP request fails, this method is called.
- (void) locationService:(SGLocationService*)service failedForResponseId:(NSString*)requestId error:(NSError*)error;
service
The SGLocationService that produced the error.
requestIdThe
request id that was used to generate the error.
error
The error that was generated.
locationService:succeededForResponseId:responseObject: |
In the case that an HTTP request succeeds, this method is called.
- (void) locationService:(SGLocationService*)service succeededForResponseId:(NSString*)requestId responseObject:(NSObject*)responseObject;
serviceThe
SGLocationService recieved a successful HTTP response.
requestIdThe
response id that was used to create the request.
responseObject
The response object.
It is up to the delegate to decide how to interpret the responseObject. The object can take on two identities, either as a NSDictionary or as a NSArray. If the responseObject matches an instance of NSDictionary then the key/values of the NSDictionary will match that of the GeoJSON representation of the record that was either created, updated or retrieved.
If the responseObject matches an instance of NSArray, then every element in the array will be a NSDictionary with its key-value pair matching the GeoJSON representaiton of a particular record.
© SimpleGeo Last Updated: 03/31/2010