AnsweredAssumed Answered

Trouble with attributes in a AGSGDBFeature

Question asked by Sven.Aanesengeodata-no-esridist Employee on Jun 23, 2016
Latest reply on Aug 2, 2016 by DGoyal-esristaff

I have trouble with access to one of the attributes in a AGSGDBFeature. Trying to figure out why I've created some dummy code to test it. The code collects all features where attribute "StorviltID" is equal to "24208" and then tries to print the value. The results returns one AGSGDBFeature, but the value in the attribute "StorviltID" is gone... How can this happen?


AGSGDBFeatureTable *table = [[GDOfflineManager sharedManager] getFeatureTableFromServiceNamed:@"SKUTT"andLayerId:@0];

    AGSQuery *q = [[AGSQuery alloc] init];

    q.whereClause = @"StorviltID = 24208";


    [table queryResultsWithParameters:q completion:^(NSArray *results, NSError *error) {

        for (AGSGDBFeature *feature in results) {

            NSLog(@"Found value for feature with StorviltID: %@", [feature valueForKey:@"StorviltID"]);

            NSLog(@"Found attribute for feature with StorviltID: %@", [feature attributeForKey:@"StorviltID"]);

            NSLog(@"Found attributeAsInteger for feature with StorviltID: %li", (long)[feature attributeAsIntegerForKey:@"StorviltID" exists:nil]);




The StorviltID attribute is of type Integer, and as the code indicates I try many different methods for collecting the value but neither with any luck. Printing the entire feature also displays that the "StorviltID" is actually gone... How is this possible when the feature was found based on this attribute?