hi
i am trying to modify the feature editing sample from arcgis for offline editing use.
for the example post above i see that it's possible to read the field from a feature layer . am i right?
my intention is to read the field needed after the template being selected.
i am currently only able to load the template selection but not able to load the field list to pop up be great if anyone can assist.
-(void)featureTypeViewController:(FeatureTypeViewController*) featureTypeViewController didSelectFeatureTemplate:(AGSFeatureTemplate*)template forFeatureLayer:(AGSFeatureLayer*)featureLayer{
NSLog(@"didselectfeaturetype :TRUE");
//set the active feature layer to the one we are going to edit
self.activeFeatureLayer = featureLayer;
//create a new feature based on the template
_newFeature = [self.activeFeatureLayer createFeatureWithTemplate:template];
//Add the new feature to the feature layer's graphic collection
//This is important because then the popup view controller will be able to
//find the feature layer associated with the graphic and inspect the field metadata
//such as domains, subtypes, data type, length, etc
//Also note, if the user cancels before saving the new feature to the server,
//we will manually need to remove this
//feature from the feature layer (see implementation for popupsContainer:didCancelEditingGraphicForPopup: below)
[self.activeFeatureLayer addGraphic:_newFeature];
//Iniitalize a popup view controller
// self.popupVC = [[[AGSPopupsContainerViewController alloc] initWithWebMap:self.webmap forFeature:_newFeature usingNavigationControllerStack:NO] autorelease];
AGSPopupInfo* info = [AGSPopupInfo popupInfoForGraphic:_newFeature];
info.allowEditGeometry = NO;
NSMutableArray* fieldInfos = [info.fieldInfos mutableCopy];
NSMutableArray* displayWorthyFields = [[[NSMutableArray alloc] init] autorelease];
for (AGSPopupFieldInfo* fieldInfo in fieldInfos) {
if([fieldInfo.fieldName isEqualToString:@"OBJECTID"] ){
[displayWorthyFields addObject:fieldInfo];
}
}
info.fieldInfos = displayWorthyFields;
self.popupVC=[[[AGSPopupsContainerViewController alloc] initWithPopupInfo:info forFeature:_newFeature usingNavigationControllerStack:NO] autorelease];
self.popupVC.delegate = self;
//Only for iPad, set presentation style to Form sheet
//We don't want it to cover the entire screen
if([[UIDevice currentDevice] isIPad])
self.popupVC.modalPresentationStyle = UIModalPresentationFormSheet;
//Animate by flipping horizontally
self.popupVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
//First, dismiss the Feature Template Picker
[self dismissModalViewControllerAnimated:YES];
//Next, Present the popup view controller //ERROR HERE
[self presentModalViewController:self.popupVC animated:YES];
[self.popupVC startEditingCurrentPopup];
}