In general, a related records table is treated an offline feature table inside a geodatabase.
Let's say you have a service with a feature service, and a related table
1. Creating and downloading the geodatabase: You treat them two separate layers in the service. For instance, your generate params might look like below where layerID 0 is your spatial layer, and layerID 1 being related table. You only need one AGSGDBSyncTask object, and get back one AGSGDBGeodatabase object
AGSGDBGenerateParameters *generateParams =[[AGSGDBGenerateParameters alloc] initWithExtent:_replicaExtent layerIDs:@[@0,@1]]; |
2. Once you get AGSGDBGeodatabase object, you would have two tables from which you create AGSGDBFeatureTable objects
3. Querying related records: You can to use AGSRelationshipQuery (similar to online workflow) which will be called on the (spatial) table.
[spatialTable queryRelatedFeaturesWithParameters:relationshipQuery completion:^(NSDictionary *results, NSError *error) { /*Enumerate results dictionary. Keys are Object IDs of spatial table, and iterate the cursor. For instance, AGSGDBQueryResultCursor *cursor = [results objectForKey:[NSNumber numberWithUnsignedInteger:572]]; AGSGDBFeature *feature = cursor.currentFeature; //Related record feature */ }]; |
4. Editing:
Once you have the related records for a feature through querying, you can display them in a popup, edit and save. An online example for presenting popups is shown in this sample here, and you can have a similar workflow.
(In your question, I think you mentioned AGSGDBFeatureServiceTable instead of AGSGDBFeatureTable. AGSGDBFeatureServiceTable is not used for offline sync workflow )
Hope this helps,
Suganya