howto: Query one to many relationship

2254
2
06-01-2011 12:18 AM
wilkostalknecht
New Contributor
See the folowing example. How do i get the valveID of a selected feature after an identify? and is the valveID meaning the OBjectsID?

//ID of the valve for which we want to find the related pipeline
NSNumber* valveID = ...;

AGSRelationshipQuery* relQuery = [AGSRelationshipQuery relationshipQuery];
relQuery.objectIds = [NSArray arrayWithObject: valveID];
relQuery.relationshipId = 0 ; //ID of 'Installed on' relationship

[queryTask executeWithRelationshipQuery: relQuery];
0 Kudos
2 Replies
NimeshJarecha
Esri Regular Contributor
Yes, you need to pass ObjectIds in relQuery.objectIds. The delegate method of AGSIdentifyTask returns array of AGSIdentifyResult and it has a identified feature as Graphic. You can get the ObjectId of the feature from it's attributes.

Regards,
Nimesh
0 Kudos
wilkostalknecht
New Contributor
Whats the statement to get AGSIdentifyResult? I'am using the FeutureLayerEditing Sample and i want to use it in:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {}

Or is there a better way to display all fields of the feature layer and the correspond-ending layer for editing?
0 Kudos