Files missing from Online-Offline Editing Sample

Discussion created by 2cm on May 27, 2012
Latest reply on Aug 8, 2012 by 394059425
Hi Guys,

For a client we are building a sketching app that has to work in online-offline modus.
The app needs to be able to start without contacting any feature layers.

The Online-Offline Editing Sample gives us clues how to work with feature layers in offline modus by loading the feature definition from local files.

In OnlineOfflineFeatureLayer.m there is
- (id)initWithURL:(NSURL *)url mode:(AGSFeatureLayerMode)mode online:(BOOL)online{
   if (self.bOnline)

        else {
            //restore features from saved feature store...
            NSDictionary *featureLayerDefinition = [self readFeatureLayerDefinition];
            NSDictionary *featureSetDictionary = [self readFeatureSet];

So the method readFeatureLayerDefinition is going to load a definition from a local file:
-(NSDictionary *)readFeatureLayerDefinition
    NSError *error = nil;
    NSDictionary *flDefinition = nil;
    NSString *filename = [self featureLayerDefinitionFilename];   
    if ([[NSFileManager defaultManager] fileExistsAtPath:filename]) {
  NSString *flDefinitionString = [NSString stringWithContentsOfFile:filename encoding:NSUnicodeStringEncoding error:&error];
        flDefinition = (NSDictionary *)[flDefinitionString AGSJSONValue];
return flDefinition;

featureLayerDefinitionFilename reads:
static NSString *kFlDefinitionFileName = @"FeatureLayerDictionary";

This file (next to static NSString *kFeatureSetFileName = @"FeatureSet";) is missing from the sample project.

Can you send/put these files online?



Chris van Aart