What do you use in place of attributes in 10.1.1 sdk?

2803
1
Jump to solution
05-22-2015 09:53 AM
anthonycatalano1
New Contributor

I'm getting an error on self.identifyResult.feature.attributes of "Property attributes not found on object type 'AGSGraphic'" on the 10.1.1 sdks what do i use in place of that?

AGisObject *gisObject = AM_AUTORELEASE([[AGisObject alloc]init]);

                gisObject.layerId = [NSString stringWithFormat:@"%d", self.identifyResult.layerId];

                gisObject.objectId = [self.identifyResult.feature.attributes objectForKey:@"OBJECTID"];

                gisObject.mapService = [self.identifyResult.feature.attributes objectForKey:@"MAPSERVICE"];

                [self.record.agisObjects addObject:gisObject];

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
DiveshGoyal
Esri Regular Contributor

There's more info on this in the Release notes for 10.1.1 (under the AGSGraphic section)

Here's an excerpt -

  • Removed property attributes. This is because the attributes are no longer stored as a dictionary in the Objective-C tier, but rather further down by core runtime in the C++ tier. You can use individual getter methods such as attributeAsStringForKey:, attributeAsDoubleForKey:exists:, andattributeAsDateForKey: to get the value of a particular attribute based on the data type you expect. You can use corresponding setter methods such as setAttributeWithString:forKey:,setAttributeWithDoubleForKey:, and so on, to set a new value for attributes. If you don't know the type of attribute, you can use attributeForKey: and setAttribute:forKey: instead, which work with NSNumber, NSString, NSDate, and NSNull types. Alternatively, you can use the method allAttributes to get a dictionary containing all the attributes. This dictionary represents a copy of the graphic's attributes, and modifying it won't affect the graphic. If you modify the dictionary, you then need to call setAllAttributes: by passing in the modified dictionary to update the graphic's attributes.

View solution in original post

1 Reply
DiveshGoyal
Esri Regular Contributor

There's more info on this in the Release notes for 10.1.1 (under the AGSGraphic section)

Here's an excerpt -

  • Removed property attributes. This is because the attributes are no longer stored as a dictionary in the Objective-C tier, but rather further down by core runtime in the C++ tier. You can use individual getter methods such as attributeAsStringForKey:, attributeAsDoubleForKey:exists:, andattributeAsDateForKey: to get the value of a particular attribute based on the data type you expect. You can use corresponding setter methods such as setAttributeWithString:forKey:,setAttributeWithDoubleForKey:, and so on, to set a new value for attributes. If you don't know the type of attribute, you can use attributeForKey: and setAttribute:forKey: instead, which work with NSNumber, NSString, NSDate, and NSNull types. Alternatively, you can use the method allAttributes to get a dictionary containing all the attributes. This dictionary represents a copy of the graphic's attributes, and modifying it won't affect the graphic. If you modify the dictionary, you then need to call setAllAttributes: by passing in the modified dictionary to update the graphic's attributes.