<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I setup a NSDictionary this this JSON? in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-do-i-setup-a-nsdictionary-this-this-json/m-p/158354#M1447</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Nimesh.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Jun 2010 18:05:37 GMT</pubDate>
    <dc:creator>ChanceYohman</dc:creator>
    <dc:date>2010-06-15T18:05:37Z</dc:date>
    <item>
      <title>How do I setup a NSDictionary this this JSON?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-do-i-setup-a-nsdictionary-this-this-json/m-p/158351#M1444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"spatialReference": {"wkid" : 4326},&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"candidates" : [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "address" : "1 MASON ST",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "location" : { "x" : -122.408951, "y" : 37.783206 },&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "score" : 75,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "attributes" : {"StreetName" : "MASON", "StreetType" : "ST"}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; },&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "address" : "49 MASON ST",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "location" : { "x" : -122.408986, "y" : 37.783460 },&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "score" : 27,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; "attributes" : {"StreetName" : "MASON", "StreetType" : "ST"}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it a NSDictionary of NSDictionaries?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jun 2010 20:01:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-do-i-setup-a-nsdictionary-this-this-json/m-p/158351#M1444</guid>
      <dc:creator>ChanceYohman</dc:creator>
      <dc:date>2010-06-14T20:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I setup a NSDictionary this this JSON?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-do-i-setup-a-nsdictionary-this-this-json/m-p/158352#M1445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This seems to work, but it's not setting up the spatial reference correctly:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
NSDictionary *sRJSON=[NSDictionary dictionaryWithObjectsAndKeys:@"4326", @"wkid", nil];
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSDictionary *locationJSON=[NSDictionary dictionaryWithObjectsAndKeys:@"-122.408951", @"x", @"37.783206", @"y", nil];
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSDictionary *attributesJSON=[NSDictionary dictionaryWithObjectsAndKeys:@"MASON", @"StreetName", @"ST", @"StreetType", nil];
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSDictionary *json=[NSDictionary dictionaryWithObjectsAndKeys:sRJSON, @"spatialReference", @"1 MASON ST", @"address", locationJSON, @"location", @"75", @"score", attributesJSON, @"attributes", nil];
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSAddressCandidate *candidate=[[AGSAddressCandidate alloc ]initWithJSON:json];
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"***Address Candidate Start***");
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Display the address cey 03.18.10
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Address Candidate String: %@",[candidate addressString]);
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Display the location cey 03.18.10
&amp;nbsp;&amp;nbsp;&amp;nbsp; //What's the spatial reference of the locator? How can I find that out at the endpoint? Wouldn't it make sense to be able to retrieve the spatial reference from the point?
&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSPoint *location = [candidate location];
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Address Candidate @ (%f,%f,%@)",[location x], [location y], [location spatialReference]);
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSDictionary *address = [candidate address];
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Address Candidate Fields Count: %d", [address count]);
&amp;nbsp;&amp;nbsp;&amp;nbsp; for(NSString *aKey in address)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Key: %@ Value: %@", aKey, [address objectForKey:aKey]);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSDictionary *attributes = [candidate attributes];
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Address Candidate Attributes Count: %d", [attributes count]);
&amp;nbsp;&amp;nbsp;&amp;nbsp; for(NSString *aKey in attributes)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Key: %@ Value: %@", aKey, [attributes objectForKey:aKey]);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Address Candidate Score: %f",[candidate score]);
&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"***Address Candidate End***");
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Output:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;2010-06-14 17:20:07.679 AGSAddressCandidate[973:207] ***Address Candidate Start***&lt;BR /&gt;2010-06-14 17:20:07.682 AGSAddressCandidate[973:207] Address Candidate String: 1 MASON ST&lt;BR /&gt;2010-06-14 17:20:07.683 AGSAddressCandidate[973:207] Address Candidate @ (-122.408951,37.783206,(null))&lt;BR /&gt;2010-06-14 17:20:07.683 AGSAddressCandidate[973:207] Address Candidate Fields Count: 0&lt;BR /&gt;2010-06-14 17:20:07.684 AGSAddressCandidate[973:207] Address Candidate Attributes Count: 2&lt;BR /&gt;2010-06-14 17:20:07.684 AGSAddressCandidate[973:207] Key: StreetType Value: ST&lt;BR /&gt;2010-06-14 17:20:07.685 AGSAddressCandidate[973:207] Key: StreetName Value: MASON&lt;BR /&gt;2010-06-14 17:20:07.685 AGSAddressCandidate[973:207] Address Candidate Score: 75.000000&lt;BR /&gt;2010-06-14 17:20:07.686 AGSAddressCandidate[973:207] ***Address Candidate End***&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:21:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-do-i-setup-a-nsdictionary-this-this-json/m-p/158352#M1445</guid>
      <dc:creator>ChanceYohman</dc:creator>
      <dc:date>2021-12-11T08:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I setup a NSDictionary this this JSON?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-do-i-setup-a-nsdictionary-this-this-json/m-p/158353#M1446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The spatialReference parameter in your JSON is outSR parameter and not the address candidates spatial reference value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;===For REST help doc===&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;outSR - The well-known ID of the spatial reference or a spatial reference json object for the returned address candidates. For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This parameter was added at 10.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;===For REST help doc===&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Change your code lines as following and you'll see location's spatial reference in the output.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; //NSDictionary *sRJSON=[NSDictionary dictionaryWithObjectsAndKeys:@"4326", @"wkid", nil];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //NSDictionary *locationJSON=[NSDictionary dictionaryWithObjectsAndKeys:@"-122.408951", @"x", @"37.783206", @"y", nil];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; NSString *locationJSON = @"{\"x\":-122.408951,\"y\":37.783206,\"spatialReference\":{\"wkid\":4326}}";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSDictionary *attributesJSON=[NSDictionary dictionaryWithObjectsAndKeys:@"MASON", @"StreetName", @"ST", @"StreetType", nil];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSDictionary *json=[NSDictionary dictionaryWithObjectsAndKeys:@"1 MASON ST", @"address", [locationJSON JSONValue], @"location", @"75", @"score", attributesJSON, @"attributes", nil];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AGSAddressCandidate *candidateTest =[[AGSAddressCandidate alloc ]initWithJSON:json];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps! Please let me know if you have any further queries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Nimesh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 17:16:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-do-i-setup-a-nsdictionary-this-this-json/m-p/158353#M1446</guid>
      <dc:creator>NimeshJarecha</dc:creator>
      <dc:date>2010-06-15T17:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I setup a NSDictionary this this JSON?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-do-i-setup-a-nsdictionary-this-this-json/m-p/158354#M1447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Nimesh.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jun 2010 18:05:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-do-i-setup-a-nsdictionary-this-this-json/m-p/158354#M1447</guid>
      <dc:creator>ChanceYohman</dc:creator>
      <dc:date>2010-06-15T18:05:37Z</dc:date>
    </item>
  </channel>
</rss>

