Select to view content in your preferred language

editing from text file

803
4
06-14-2012 07:06 AM
VIKRANTKRISHNA
Regular Contributor
I am trying to create offline editing application. What I am doing is that storing comma separated features in a text file in offline mode and then want to read this text file when in online mode and update the feature layer. I have no idea how to read features from text file and apply updateFeatures function to the feature layer.

Any help?
0 Kudos
4 Replies
RickJones
Deactivated User
Have a look at the OnlineOffline Editing sample.

It should give you an idea of what to do. It uses JSON for the layer definition and data files.
0 Kudos
VIKRANTKRISHNA
Regular Contributor
Have a look at the OnlineOffline Editing sample.

It should give you an idea of what to do. It uses JSON for the layer definition and data files.



Hi Rick,
         Thanks for the reply. I tried to follow the concept in OnlineOffline sample , but no luck yet. I couldn't understand why there are multiple write and read function  i.e, writeFeatureLayerDefinition, writeFeatureSet and writeAddedFeatures. I am very new to iOS development so can't everything in the sample. In my application I don't need to add or delete features, I just need update the features from textfile when get online.
0 Kudos
VIKRANTKRISHNA
Regular Contributor
Hi Rick,
         Thanks for the reply. I tried to follow the concept in OnlineOffline sample , but no luck yet. I couldn't understand why there are multiple write and read function  i.e, writeFeatureLayerDefinition, writeFeatureSet and writeAddedFeatures. I am very new to iOS development so can't everything in the sample. In my application I don't need to add or delete features, I just need update the features from textfile when get online.



I am trying to implement the writeAddedFeatures and readAddedFeatures function from OnlineOffline sample. I am able to write the features exactly given in the sample, but in my readAddedfeatures function IO am getting an error "-[AGSGraphic graphic] inrecoganized selector sent to instance 0x84cf270" and "Terminating due to uncaught exception 'NSInvalidArgumentEception'"
0 Kudos
RickJones
Deactivated User
From what I can tell, the AddedFeatures file is where the features added since you went offline would go.

You could change the read/write routines for them, or change your file to match.

When you go Online, it checks for any added features, and updates the layer.
0 Kudos