AGSFeatureTable fieldForName returns error if not found

653
2
Jump to solution
06-01-2020 05:25 PM
MichaelDavis3
Occasional Contributor III

Correct me if I'm wrong but the docs for AGSFeatureTable fieldForName indicate that the return value is a nullable AGSField, however if I request a field that does not exist it errors with the following:

ArcGIS Runtime Error Occurred. Set a breakpoint on C++ exceptions to see the original callstack and context for this error:  Error Domain=com.esri.arcgis.runtime.error Code=3017 "The requested field was not found." UserInfo={NSLocalizedFailureReason=platform position is not a field name., NSLocalizedDescription=The requested field was not found., Additional Message=platform position is not a field name.}

C++ breakpoint doesn't return anything helpful.

Docs here:

ArcGIS Runtime SDK for iOS: AGSFeatureTable Class Reference 

Shouldn't this return NULL if the field isn't found?  How should I determine if a given field name exists in an AGSFeatureTable without iterating through every field in AGSFeatureTable.fields?

0 Kudos
1 Solution

Accepted Solutions
Nicholas-Furness
Esri Regular Contributor

You can safely ignore the exception. It doesn't propagate up out of the Runtime, it's merely logged to the console (I suspect we should hide that logging - I'll raise this with the team).

The result you get back from the fieldForName() call is still nil, right?

If Xcode is stopping, you should remove any breakpoints on C++ exceptions.

Does that help?

Nick.

View solution in original post

2 Replies
Nicholas-Furness
Esri Regular Contributor

You can safely ignore the exception. It doesn't propagate up out of the Runtime, it's merely logged to the console (I suspect we should hide that logging - I'll raise this with the team).

The result you get back from the fieldForName() call is still nil, right?

If Xcode is stopping, you should remove any breakpoints on C++ exceptions.

Does that help?

Nick.

MichaelDavis3
Occasional Contributor III

Yeah it's only a show stopper if the feature table isn't loaded... which turns out was the larger issue I needed to deal with.  I'm mid-way through upgrading a large and (to me anyway) complex app from 10.x to 100.x so the C++ breakpoints are helping me catch all the spots where I missed bits in the initial flurry of finding and replacing.

0 Kudos