-(IBAction)syncInspections:(id)sender{ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentDir = [paths1 objectAtIndex:0]; NSString *readPolyFile = [documentDir stringByAppendingPathComponent:@"InfraPolygonFile.txt"]; NSString *readLineFile = [documentDir stringByAppendingPathComponent:@"InfraLinesFile.txt"]; NSString *readPointFile = [documentDir stringByAppendingPathComponent:@"InfraPointFile.txt"]; NSString *addedPolygonString = [NSString stringWithContentsOfFile:readPolyFile encoding:NSUnicodeStringEncoding error:nil] ; NSMutableDictionary *polyDict = [addedPolygonString AGSJSONValue]; NSArray *polyArray = [AGSJSONUtility decodeFromDictionary:polyDict withKey:@"features" fromClass:[AGSGraphic class]]; if(polyArray.count){ [self.impactPolygon updateFeatures:polyArray]; } NSString *addedPointString = [NSString stringWithContentsOfFile:readPointFile e ncoding:NSUnicodeStringEncoding error:nil] ; NSMutableDictionary *pointDict = [addedPointString AGSJSONValue]; NSArray *pointArray = [AGSJSONUtility decodeFromDictionary:pointDict withKey:@"features" fromClass:[AGSGraphic class]]; if(pointArray.count){ [self.impactPoints updateFeatures:pointArray]; } NSString *addedLinesString = [NSString stringWithContentsOfFile:readLineFile encoding:NSUnicodeStringEncoding error:nil] ; NSMutableDictionary *linesDict = [addedLinesString AGSJSONValue]; NSArray *linesArray = [AGSJSONUtility decodeFromDictionary:linesDict withKey:@"features" fromClass:[AGSGraphic class]]; if(linesArray.count){ [self.impactLine updateFeatures:linesArray]; } } - (void)featureLayer:(AGSFeatureLayer *)featureLayer operation:(NSOperation *)op didFailFeatureEditsWithError:(NSError *)error { NSLog(@"%@,%@",error.localizedDescription, featureLayer.name); }
Solved! Go to Solution.
file 1: {"geometryType":"esriGeometryPolygon","features":[{"geometry":{"spatialReference":{"wkid":26915},"rings":[[[454624.71300000045,5002318.9177999999],[454948.50889999978,5001754.4406000003],[454239.10940000042,5001505.4506999999],[454624.71300000045,5002318.9177999999]]]},"attributes":{"CostToRepair":"25000","USNG":null,"OBJECTID":5602,"Latitude":null,"Notes":null,"Longitude":null,"IncidentID":1,"Structure":null,"Category":7}},{"geometry":{"spatialReference":{"wkid":26915},"rings":[[[456335.37490000029,5001531.3358999984],[456678.07160000037,5001735.495600001],[456811.74760000024,5001378.2160999998],[456371.83200000029,5001217.8048999999],[456335.37490000029,5001531.3358999984]]]},"attributes":{"CostToRepair":"20000","USNG":null,"OBJECTID":2002,"Latitude":null,"Notes":null,"Longitude":null,"IncidentID":1,"Structure":4,"Category":1}}],"spatialReference":{"wkid":26915}} file 2: {"geometryType":"esriGeometryPolyline","features":[{"geometry":{"paths":[[[456694.88599999977,5001929.1936000008],[457409.26250000019,5000738.5662999982],[456456.76059999969,5000579.8160000006]]],"spatialReference":{"wkid":26915}},"attributes":{"CostToRepair":"2200","USNG":null,"OBJECTID":4401,"Latitude":null,"Notes":null,"Longitude":null,"IncidentID":1,"Structure":3,"Category":4}}],"spatialReference":{"wkid":26915}} file 3: {"geometryType":"esriGeometryPoint","features":[{"geometry":{"x":455925.14580000023,"y":5001122.9238000009,"spatialReference":{"wkid":26915}},"attributes":{"CostToRepair":"1500","USNG":null,"OBJECTID":10403,"Latitude":null,"Notes":null,"Longitude":null,"IndicentID":1,"Structure":3,"Category":5}},{"geometry":{"x":454339.92470000032,"y":5000404.7103000004,"spatialReference":{"wkid":26915}},"attributes":{"CostToRepair":"15000","USNG":null,"OBJECTID":13203,"Latitude":null,"Notes":null,"Longitude":null,"IndicentID":1,"Structure":2,"Category":1}},{"geometry":{"x":455925.14580000023,"y":5001122.9238000009,"spatialReference":{"wkid":26915}},"attributes":{"CostToRepair":"2500","USNG":null,"OBJECTID":10403,"Latitude":null,"Notes":null,"Longitude":null,"IndicentID":1,"Structure":3,"Category":2}}],"spatialReference":{"wkid":26915}}