AnsweredAssumed Answered

Copying Attributes from one Graphic to another

Question asked by jgiesler on Aug 22, 2013
Latest reply on Aug 23, 2013 by jgiesler
Hey Everyone,
I am trying to transfer attributes from one graphic to another.  When I run it, it seems like it is going to work.  The attributes in the popup look are the ones I am trying to copy.  When I refresh the map the attributes revert back to the old ones.  I don't know what I am missing.  This worked before I upgraded to 10.0.1 sdk, minus the changes to the setAllAttributes.
Code Posted below
Where I assign the attributes
-(void) DoneAssociatingFeatures {     NSNumber *numberSketch = [NSNumber numberWithInteger:[self.activeFeatureLayer objectIdForFeature:GraphictoEdit]];     for (AGSGraphic *graphic in     {         NSNumber *number = [NSNumber numberWithInteger:[self.activeFeatureLayer objectIdForFeature:graphic]];         AGSGeometryEngine *geometryEngine = [AGSGeometryEngine defaultGeometryEngine];         if ([geometryEngine geometry:self.editGeometrySketchGraphicsLayer.geometry withinGeometry:graphic.geometry])         {              if ([numberSketch isEqualToNumber:number]){}             else             {                 for (id key in graphic.allAttributes)                 {                     if (![key isEqual: @"OBJECTID"])                     {                         id value = [graphic.allAttributes objectForKey:key];                         NSLog(@"Graphic Value %@",value);                         [self.popupVC.currentPopup.graphic setAttribute:value forKey:key];                     }                 }             }         }     }     [self presentModalViewController:self.popupVC animated:YES];     self.mapView.touchDelegate = self;     [self.editGeometrySketchGraphicsLayer clear]; }

Finished editing graphic
-(void) popupsContainer:(id<AGSPopupsContainer>)popupsContainer didFinishEditingGraphicForPopup:(AGSPopup *)popup {     [self.bezierImageView removeFromSuperview];     self.activeFeatureLayer = (AGSFeatureLayer*) popup.featureLayer;     popup.graphic.geometry = [[AGSGeometryEngine defaultGeometryEngine]simplifyGeometry:popup.graphic.geometry];     popup.graphic.geometry = [[AGSGeometryEngine defaultGeometryEngine]normalizeCentralMeridianOfGeometry:popup.graphic.geometry];     int oid = [self.activeFeatureLayer objectIdForFeature:popup.graphic];     if(oid >0)     {         //Has valid oid and is only updated on server         [self.activeFeatureLayer updateFeatures:[NSArray arrayWithObject:popup.graphic]];     }     else     {         // does not have valid oid and is add as a new feature         [self.activeFeatureLayer addFeatures:[NSArray arrayWithObject:popup.graphic]];     }     if (AppDelagate.ActiveProject != nil)     {         if ([popup.graphic.geometry isEqual:AppDelagate.ActiveProject.geometry])         {             AppDelagate.ActiveProject.allAttributes = popup.graphic.allAttributes;         }     }     [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];   }