We are trying to connect to a web server and modify a feature layer. We are able to access and change a "stations" layer we created, but we are unable to change the feature layer for mission attributes. The set of code we are using is
-(void) viewDidLoad
{ self.mapView.touchDelegate = self;
self.mapView.calloutDelegate = self;
self.mapView.showMagnifierOnTapAndHold = YES;
self.webmap = [AGSWebMap webMapWithItemId:@"2974209e5f3544c9be61cf33fe3a4d2b" credential:nil];
//designate a delegate to be notified as web map is opened
self.webmap.delegate = self;
[self.webmap openIntoMapView:self.mapView];
}
-(void)mapView: (AGSMapView *)mapView didClickCalloutAccessoryButtonForGraphic: (AGSGraphic *)graphic{
self.activeFeatureLayer = (AGSFeatureLayer*) graphic.layer;
AGSPopupInfo *info = [AGSPopupInfo popupInfoForGraphic:graphic];
self.popupVC = [[[AGSPopupsContainerViewController alloc] initWithPopupInfo:info graphic:graphic usingNavigationControllerStack:NO] autorelease];
self.popupVC.delegate = self;
/*******************/
self.popupVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
NSLog(@"Graphics Information : %@", [graphic.attributes objectForKey:@"NUM_LIVE"] );
NSLog(@"Graphics Information : %@", graphic.attributes );
[graphic.attributes setObject:[NSNumber numberWithInteger:42] forKey:@"NUM_LIVE"]; [self.activeFeatureLayer updateFeatures:[NSArray arrayWithObject:graphic]];
//add button functionality
//This will load up a new detail view for our project.
SecondDetailViewController *secondDetailViewController = [[SecondDetailViewController alloc] initWithNibName:@"SecondDetailView" bundle:nil];
[self.navigationController pushViewController:secondDetailViewController animated:NO]; }
When I access the station layer, I am able to update and change numbers, strings, etc. But every time I try to modify the other layer, it kicks back an error message saying that "could not save edits. please try again."
Thank you.