AnsweredAssumed Answered

How to open local geodatabase?

Question asked by itthisakp12 on Nov 9, 2015
Latest reply on Nov 10, 2015 by NFurness-esristaff

I use Xcode to create a project for load a geodatabase but I cannot access a geodatabase which shares with arcmap.

It throws an exception when I try to get feature tables.

NSString *path = [[NSBundle mainBundle] pathForResource:@"newplan" ofType:@"geodatabase"];
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
    NSString *docPath = [documentsDirectory stringByAppendingPathComponent:@"newplan.geodatabase"];
    if (![fileManager fileExistsAtPath:docPath])
        [fileManager copyItemAtPath:path toPath:docPath error:&error];
    if([fileManager fileExistsAtPath:docPath])
        AGSGDBGeodatabase *gdb = [[AGSGDBGeodatabase alloc] initWithPath:docPath error:&error];