I'm updating some apps from runtime 2.5 to 100.4
It looks like the AGSGDBFeatureTable saveFeature method has been replaced by the AGSGeodatabaseFeatureTable addFeature and updateFeature methods.
Do I need to detect if the feature is "new" and use the appropriate add or update method now?
Solved! Go to Solution.
That is correct. For new features, you would first create a feature using one of the create methods on AGSGeodatabaseFeatureTable. Once created, you can add the feature to the table using the add method.
For existing features, you typically get a reference to the feature first (query, identify etc), edit and call the update method.
Hope that helps.
That is correct. For new features, you would first create a feature using one of the create methods on AGSGeodatabaseFeatureTable. Once created, you can add the feature to the table using the add method.
For existing features, you typically get a reference to the feature first (query, identify etc), edit and call the update method.
Hope that helps.
Thanks - I have tons of generic edit views where I might have either a new or existing feature that is being edited. Previously the saveFeature method worked fine for either, but I guess I'll have to use AGSGeodatabaseFeatureTable's canUpdateFeature to check if it is new (not updatable) or not and take the appropriate route.
Am I assuming correctly that a new feature will return a NO when I check with canUpdateFeature?
Yes, it would. A feature created just exists in memory whereas an update operation is done on the table. canUpdateFeature would return true after you've added the feature to the table using add method.