cyohman

AGSLocator, AGSLocatorDelegate, AGSAddressCandidate Tutorial

Discussion created by cyohman on Mar 18, 2010
Latest reply on Mar 19, 2010 by cyohman
As promised, I've been developing code tutorials by digging into code and treating it like Legos. Ooh, what happens if I put this here? Attached is a tutorial using the above classes and protocols. The comments and questions I will spurt off are in the code. Please enjoy and participate in the discussion.

Important Note: For simplicity of implementation, everything is output to the console.

For the returnFields passed to the AGSLocator object via the locationsForAddress function, is there a better way to initialize the NSArray of Strings? There seems to be no notion of initializer lists in Objective-C and the NSArray class method arrayWithObjects doesn't appear to work with a parameter list of @"" string literals. Am I missing something here? What am I missing?

Where can I figure out the spatial reference for a GeocodeServer? I poked around the REST endpoint, but couldn't find the answer I wanted. Also, why does AGSPoint not return it's spatial reference through an accessor ("getter", I forgot if there is Apple specific term for this)?

Most importantly, look in the "This doesn't work?" block in the didFindLocationsForAddress method. It appears the NSDictionary address property is returned improperly. The count is null and there are 0 keys and values, respectively. Set a breakpoint on 150 and hover over candidate to inspect the candidate's address property.

Thanks for reading and composing any thoughts. :)

Attachments

Outcomes