Trying to get envelope information

Discussion created by jlchapman4 on Dec 14, 2011
Latest reply on Dec 15, 2011 by njarecha-esristaff
I'm new at this, I'm trying to get envelope information from a AGSFeatureSet.  My query works, it returns 1 object.  I also used the returnGeometry = YES in my setup of the query.  The problem I'm having is I cannot write the statement correctly to get the envelope information.  My statement keeps giving me an error when I add .geometry.  Here is the code:

- (void)queryTask:(AGSQueryTask *)queryTask operation:(NSOperation *)op didExecuteWithFeatureSetResult:(AGSFeatureSet *)featureSet
    AGSEnvelope *env = [((AGSFeatureSet*)[featureSet.features objectAtIndex:0]).geometry];
    [self.mapView zoomToEnvelope:env animated:YES];
Any help would be appreciated,