Hello,
#pragma mark - AGSFindTaskDelegate
-(void)findTask:(AGSFindTask *)findTask operation:(NSOperation *)op didExecuteWithFindResults:(NSArray *)results
is it possible to stop above callback to received data?
if data is very big above delegate called for longer time as long as all data is received, but if user click on back of view or comes out from view ..... app crash on click on GIS VIEW again.
is it possible to stop callback response like after 60 Sec or if user comes out from VIEW ?
Thanks,
Hi Gaja,
QueryTask returns a NSOperation, which you can cancel by calling cancel() method.
QueryTask has property named timeoutInterval which by default is set to 60 seconds.
So it should time out if it takes longer than that. But you could make that time shorter.
Let me know if this solves your issue.
regards,
David
When you invoke the FindTask using executeWithParameters: , you get back a reference to the NSOperation representing the async operation. You can call cancel on the operation to stop it from processing or waiting for the response.
[op cancel];
have added inside callback but still its been called.....
Inside the callback won't have any affect because by that time the operation is already done.
@property (nonatomic, strong) NSOperation *m_FindOP;
self.m_FindOP = [self.m_findTask executeWithParameters:self.m_findParams];
- (void) btnBack
{
[self.m_FindOP cancel];
self.m_FindOP = nil;
}
with above lines of code added, still callback get response...
any further suggestion.....?
This might not related to the "break the call back" code suggestion,
But from an iOS application, it is better to narrow down the find/query result to a more precious and accurate value, which means a less value return that match with the find/query category. If a find result takes more than 60 mins I would suggest to redefine the data attribute or search category.
did testing, only for some scenarios it is not possible to narrow down result, depend of address we get results, and we do have 1Min, AlterView so users is freeze to use any other functionality while receiving call back, but after that if user comes out from controller, break point does hit on above callback. and if i click on GIS (same controller open)again then it crash... so i was checking out if like in Location Search Stop Location Search functionality is available, which stop further callback, do we have here in any way...
however will try to reduce search if possible.. Thx