<?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: cannot edit/add on feature layer in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/cannot-edit-add-on-feature-layer/m-p/6279#M66</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like the inspectionLayer will not have had a chance to reach out to the REST endpoint to interrogate whether it can handle edits yet or not. The inspectionLayer.loaded property will be false, and you can't use the layer until it's true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either instantiate the AGSFeatureLayer earlier in your app (perhaps on viewDidLoad) and store it as a property, or else set its delegate property and wait to receive the AGSLayerDelegate::layerDidLoad message before inspecting the properties or saving the feature. I recommend the former. It's a lightweight object and fine to keep around like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As some background: To avoid blocking the main thread, the action of reaching out to the REST endpoint is queued up and requires the run loop to free up before the round-trip HTTP request happens. This won't happen anywhere between lines 2 and 24 in your sample (the "AGSFeatureLayer::loaded" property will be false). This is true of all components in the runtime that make potentially lengthy URL requests (tasks, layers, portals, etc.).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Sep 2015 12:55:22 GMT</pubDate>
    <dc:creator>Nicholas-Furness</dc:creator>
    <dc:date>2015-09-03T12:55:22Z</dc:date>
    <item>
      <title>cannot edit/add on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/cannot-edit-add-on-feature-layer/m-p/6278#M65</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My testing server has the following functions:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screen Shot 2015-09-03 at 11.31.46.png" class="image-1 jive-image" src="/legacyfs/online/125006_Screen Shot 2015-09-03 at 11.31.46.png" style="width: 620px; height: 54px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to draw a polygon and add the new polygon to this layer, but all the property canCreate/canDelete/canUpdate/canUpdateGeometry return NO, and of course, I failed to add graphic to this layer. Is anything I missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #4f8187;"&gt;AGSGraphic&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; *newGraphic = [&lt;/SPAN&gt;&lt;SPAN style="color: #4f8187;"&gt;AGSGraphic&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;graphicWithGeometry&lt;SPAN style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #bb2ca2;"&gt;self&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #4f8187;"&gt;sketchLayer&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #4f8187;"&gt;geometry&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;symbol&lt;SPAN style="color: #000000;"&gt;:[&lt;/SPAN&gt;&lt;SPAN style="color: #bb2ca2;"&gt;self&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;getMapSymbolByType&lt;SPAN style="color: #000000;"&gt;:&lt;/SPAN&gt;eIfosMapSymbolTypePolygon&lt;SPAN style="color: #000000;"&gt;] &lt;/SPAN&gt;attributes&lt;SPAN style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #272ad8;"&gt;@{&lt;/SPAN&gt;&lt;SPAN style="color: #d12f1b;"&gt;@"attire"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #d12f1b;"&gt;@"testttt"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #d12f1b;"&gt;@"attr2"&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #d12f1b;"&gt;@"test22"&lt;/SPAN&gt;&lt;SPAN style="color: #272ad8;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;];&lt;/SPAN&gt;
&lt;SPAN style="color: #000000;"&gt;&lt;SPAN style="color: #4f8187;"&gt;AGSFeatureLayer&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; *inspectionLayer = [&lt;/SPAN&gt;&lt;SPAN style="color: #4f8187;"&gt;AGSFeatureLayer&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;featureServiceLayerWithURL&lt;SPAN style="color: #000000;"&gt;:[&lt;/SPAN&gt;&lt;SPAN style="color: #703daa;"&gt;NSURL&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3d1d81;"&gt;URLWithString&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="color: #78492a;"&gt;LAYER_URL_STR&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;] &lt;/SPAN&gt;mode&lt;SPAN style="color: #000000;"&gt;:&lt;/SPAN&gt;AGSFeatureLayerModeSnapshot&lt;SPAN style="color: #000000;"&gt;];&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN style="color: #000000;"&gt;inspectionLayer.&lt;SPAN style="color: #4f8187;"&gt;editingDelegate&lt;/SPAN&gt; = &lt;SPAN style="color: #bb2ca2;"&gt;self&lt;/SPAN&gt;;&lt;/SPAN&gt;
&lt;SPAN style="color: #000000;"&gt;// return NO&lt;/SPAN&gt;
&lt;SPAN style="color: #bb2ca2;"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="font-family: Menlo; font-size: 11px;"&gt;inspectionLayer&lt;/SPAN&gt;.&lt;SPAN style="color: #4f8187;"&gt;canCreate&lt;/SPAN&gt;) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(&lt;SPAN style="color: #d12f1b;"&gt;@"can create"&lt;/SPAN&gt;);
}

&lt;SPAN style="color: #000000;"&gt;// return NO&lt;/SPAN&gt;
&lt;SPAN style="line-height: 1.5; color: #bb2ca2;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; (&lt;SPAN style="font-family: Menlo; font-size: 11px;"&gt;inspectionLayer&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5; color: #4f8187;"&gt;canDelete&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt;) {&lt;/SPAN&gt;
&lt;SPAN style="line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: Menlo; font-size: 11px;"&gt;NSLog&lt;/SPAN&gt;&lt;/SPAN&gt;(&lt;SPAN style="color: #d12f1b;"&gt;@"can delete"&lt;/SPAN&gt;);
}

&lt;SPAN style="color: #000000;"&gt;// return NO&lt;/SPAN&gt;
&lt;SPAN style="line-height: 1.5; color: #bb2ca2;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; (&lt;SPAN style="font-family: Menlo; font-size: 11px;"&gt;inspectionLayer&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5; color: #4f8187;"&gt;canUpdate&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt;) {&lt;/SPAN&gt;
&lt;SPAN style="line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: Menlo; font-size: 11px;"&gt;NSLog&lt;/SPAN&gt;&lt;/SPAN&gt;(&lt;SPAN style="color: #d12f1b;"&gt;@"can update"&lt;/SPAN&gt;);
}

&lt;SPAN style="color: #000000;"&gt;// return NO&lt;/SPAN&gt;
&lt;SPAN style="line-height: 1.5; color: #bb2ca2;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; (&lt;SPAN style="font-family: Menlo; font-size: 11px;"&gt;inspectionLayer&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5; color: #4f8187;"&gt;canUpdateGeometry&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt;) {&lt;/SPAN&gt;
&lt;SPAN style="line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: Menlo; font-size: 11px;"&gt;NSLog&lt;/SPAN&gt;&lt;/SPAN&gt;(&lt;SPAN style="color: #d12f1b;"&gt;@"can&amp;nbsp; update geometry"&lt;/SPAN&gt;);
}

&lt;SPAN style="line-height: 1.5;"&gt;[inspectionLayer &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5; color: #31595d;"&gt;applyEditsWithFeaturesToAdd&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt;:[&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5; color: #703daa;"&gt;NSArray&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5; color: #3d1d81;"&gt;arrayWithObject&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt;:newGraphic] &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5; color: #31595d;"&gt;toUpdate&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5; color: #bb2ca2;"&gt;nil&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt; &lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5; color: #31595d;"&gt;toDelete&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5; color: #bb2ca2;"&gt;nil&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5;"&gt;];&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 20:15:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/cannot-edit-add-on-feature-layer/m-p/6278#M65</guid>
      <dc:creator>QKunZhu</dc:creator>
      <dc:date>2021-12-10T20:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: cannot edit/add on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/cannot-edit-add-on-feature-layer/m-p/6279#M66</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like the inspectionLayer will not have had a chance to reach out to the REST endpoint to interrogate whether it can handle edits yet or not. The inspectionLayer.loaded property will be false, and you can't use the layer until it's true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either instantiate the AGSFeatureLayer earlier in your app (perhaps on viewDidLoad) and store it as a property, or else set its delegate property and wait to receive the AGSLayerDelegate::layerDidLoad message before inspecting the properties or saving the feature. I recommend the former. It's a lightweight object and fine to keep around like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As some background: To avoid blocking the main thread, the action of reaching out to the REST endpoint is queued up and requires the run loop to free up before the round-trip HTTP request happens. This won't happen anywhere between lines 2 and 24 in your sample (the "AGSFeatureLayer::loaded" property will be false). This is true of all components in the runtime that make potentially lengthy URL requests (tasks, layers, portals, etc.).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2015 12:55:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/cannot-edit-add-on-feature-layer/m-p/6279#M66</guid>
      <dc:creator>Nicholas-Furness</dc:creator>
      <dc:date>2015-09-03T12:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: cannot edit/add on feature layer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/cannot-edit-add-on-feature-layer/m-p/6280#M67</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much Nicholas. I use the AGSLayerDelegate::layerDidLoad to dismiss my loading screen after loading and then it's able to commit the new created graphic.It works fine now. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2015 09:30:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/cannot-edit-add-on-feature-layer/m-p/6280#M67</guid>
      <dc:creator>QKunZhu</dc:creator>
      <dc:date>2015-09-04T09:30:46Z</dc:date>
    </item>
  </channel>
</rss>

