Offline editing

Discussion created by vikrant327 on Nov 2, 2012
I am trying to implement offline editing of feature layer. In the popupsContainerDidFinishViewPopups menthod, I check for offline status of the device, if offline then I am writing the featureSet to a text file as.

AGSGraphic *graphicToWrite = self.popupVC.currentPopup.graphic;

[self.OfflinePoints addObject:graphicToWrite];

AGSFeatureSet *fSet = [AGSFeatureSet featureSetWithFeatures:self.OfflinePoints];

NSString *str = [NSString stringWithFormat:@"%@", [[fSet encodeToJSON] AGSJSONRepresentation]];

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
             NSString *documentDir = [paths objectAtIndex:0];
             NSString *readFile = [documentDir stringByAppendingPathComponent:@"pointFile.txt"];

BOOL bSuccess = [str1 writeToFile:readFile
             NSLog(@"Success %@", bSuccess ? @"YES" : @"NO");

The problem here is that there are some values in the attribute which are null. Output written to the textfile looks like this


All the null values are written as "null".

While updating the featureSet,  I am getting in error log  "GET" method not supported.

I tried this in the REST page and what I noticed was all that String type attributes are fine with "null", but there are some fields which are of type integer or double, and "null" doesn't work for them.

Is there anything I can do to take care of this while writing to text file.