AGSMapServiceInfo not notifying delegate on retrieveLegendInfo

2965
3
Jump to solution
07-24-2012 05:22 AM
DanielMonego
New Contributor II
I have an instance of AGSMapserviceInfo which I'm trying to use to retrieve legend info:


-(void)queryLegendWithMapServiceInfo:(AGSMapServiceInfo *)msi {     if(msi.version >= 10.01)     {          msi.delegate = self;         [msi retrieveLegendInfo];     }else {         NSLog(@"Skipping layer [%@]. ArcGIS Service must be version 10 SP1 or above",msi.URL );     } }  - (void)mapServiceInfo:(AGSMapServiceInfo *)mapServiceInfo operationDidRetrieveLegendInfo:(NSOperation*)op {  NSLog(@"Do stuff"); }   - (void)mapServiceInfo:(AGSMapServiceInfo *)mapServiceInfo operation:(NSOperation*)op didFailToRetrieveLegendInfoWithError:(NSError*)error{  NSLog(@"Error encountered while fetching legend : %@",error); }


Unfortunately, this doesn't notify the delegate on either the didFailToRetrieveLegendInfoWithError or on the operationDidRetrieveLegendInfo methods. I've checked this in the debugger and under the Allocations instrument, and msi is neither nil or deallocated. Is there another reason why this call wouldn't even give an error?
0 Kudos
1 Solution

Accepted Solutions
DanielMonego
New Contributor II
I resolved the problem outside of this sample - the above code was being called by a NSOperation that was being killed before the AGSMapServiceInfoDelegate received the callbacks.

View solution in original post

0 Kudos
3 Replies
NimeshJarecha
Esri Regular Contributor
Are you adopting the AGSMapServiceInfoDelegate protocol in your class?

Regards,
Nimesh
0 Kudos
DanielMonego
New Contributor II
I resolved the problem outside of this sample - the above code was being called by a NSOperation that was being killed before the AGSMapServiceInfoDelegate received the callbacks.
0 Kudos
NimeshJarecha
Esri Regular Contributor
Good to know that you got it working!

Regards,
Nimesh
0 Kudos