Question on AGSGDBGeodatabase?

2349
2
01-28-2014 10:12 PM
c_f_ong
New Contributor III
Hello

I've used ArcGIS Desktop 10.2.1 to generate a local geodatabase and added it to my project. Please refer to below for the code I've used to access the geodatabase. However, I've encountered an error as shown below.

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *docsPath = [paths objectAtIndex:0];
    NSString *path = [docsPath stringByAppendingPathComponent:@"route_points.geodatabase"];
    NSError *err = nil;
    AGSGDBGeodatabase *gdb = [[AGSGDBGeodatabase alloc] initWithPath:path error:&err];
    NSLog(@"error %@", err.description);

error Error Domain=com.Esri.ArcGIS.ErrorDomain Code=10003 "SELECT ObjectID, Definition, Type FROM GDB_Items WHERE Name = ? collate nocase AND  Type = ?

Any idea what maybe the cause? Any solution?

Thanks.

Rgds
Ong CF
0 Kudos
2 Replies
DiveshGoyal
Esri Regular Contributor
Would you be able to share the geodatabase so that we can investigate?
0 Kudos
AndriyGalushka
New Contributor III
Hello

I've used ArcGIS Desktop 10.2.1 to generate a local geodatabase and added it to my project. Please refer to below for the code I've used to access the geodatabase. However, I've encountered an error as shown below.

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *docsPath = [paths objectAtIndex:0];
    NSString *path = [docsPath stringByAppendingPathComponent:@"route_points.geodatabase"];
    NSError *err = nil;
    AGSGDBGeodatabase *gdb = [[AGSGDBGeodatabase alloc] initWithPath:path error:&err];
    NSLog(@"error %@", err.description);

error Error Domain=com.Esri.ArcGIS.ErrorDomain Code=10003 "SELECT ObjectID, Definition, Type FROM GDB_Items WHERE Name = ? collate nocase AND  Type = ?

Any idea what maybe the cause? Any solution?

Thanks.

Rgds
Ong CF


Add you "route_points.geodatabase" in TARGETS/project target/Build Phases/Copy Bundle Resources/
0 Kudos