Save feature with GUID field to local SQLite geodatabase

2504
2
Jump to solution
03-31-2014 04:32 AM
JustinBurns1
New Contributor II
Hi,

I am using the 10.2.2 version of the SDK and working with the offline editing capabilities.  The particular layer I am working with has a GUID type field in addition to the GlobalID field.  When I try to save a new AGSGDBFeature to the AGSGDBFeatureTable the app crashes.  I have been able to successfully save to that layer without supplying a value for the GUID field.  SQLite does not have a GUID datatype.  When Server for ArcGIS generates the geodatabase it represents GUID field types as uuidtext custom type in SQLite.  The name suggests that this is a text type field.  If I open the geodatabase in SQLite Manager (Firefox add-in) I can successfully paste a GUID string into the edit dialog for a row and save.  This tells me that it is not a SQLite error.  I'm wondering if anyone else has tried this yet and if this may be a bug in the SDK.

    AGSGDBFeatureTable* fbFeatTable = [self.geodatabase featureTableForLayerID:1];     if (fbFeatTable.canCreate && fbFeatTable.canUpdate)     {         AGSGDBFeature* feature = [[AGSGDBFeature alloc] initWithTable:fbFeatTable];          // I've tried these variations         //[feature setAttribute:[NSUUID UUID] forKey:@"RecGuid"];         //[feature setAttribute:[[NSUUID UUID] UUIDString] forKey:@"RecGuid"];         //[feature setAttribute:[NSString stringWithFormat:@"{%@}", [[NSUUID UUID] UUIDString]] forKey:@"RecGuid"];         [feature setAttributeWithString:[NSString stringWithFormat:@"{%@}", [[NSUUID UUID] UUIDString]] forKey:@"RecGuid"];          [feature setAttributeWithString:@"Test1" forKey:@"aaa"];         [feature setGeometry:geometry];                  NSError* saveError;         if ([fbFeatTable saveFeature:feature error:&saveError])          {             NSLog(@"Saved.");         }         else         {             NSLog(@"Error Saving: %@", saveError);         }     }     else     {         NSLog(@"%@ does not allow new features.", fbFeatTable.tableName);     }


Thanks,
Justin
0 Kudos
1 Solution

Accepted Solutions
DiveshGoyal
Esri Regular Contributor
Thanks for reporting this issue. It will be resolved in the upcoming release (v10.2.3).

View solution in original post

0 Kudos
2 Replies
DiveshGoyal
Esri Regular Contributor
Justin, can you attach the .geodatabase you're using? We'll try this out.
0 Kudos
DiveshGoyal
Esri Regular Contributor
Thanks for reporting this issue. It will be resolved in the upcoming release (v10.2.3).
0 Kudos