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); }
Solved! Go to Solution.