searching all layers

801
5
Jump to solution
10-05-2012 05:46 AM
HamzaHaroon
Occasional Contributor
I'm using the findTaskDemo sample, and want to know how I can make it search through all of the layers. So how can I search without any searchField or layerIds objects of the findParams. Would i just set them to nil arrays and use the search like in the example?
0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor
If you do not specify searchFields then all fields are searched. However, layerIds are mandatory. You'll have to pass array of all layer ids if you want to search all of them.

Regards,
Nimesh

View solution in original post

0 Kudos
5 Replies
NimeshJarecha
Esri Regular Contributor
If you do not specify searchFields then all fields are searched. However, layerIds are mandatory. You'll have to pass array of all layer ids if you want to search all of them.

Regards,
Nimesh
0 Kudos
HamzaHaroon
Occasional Contributor
ok thanks. im trying that now, but it seems that my delegate method is not fired.
I have self.findTask.delegate = self; and am using the AGSFindTaskDelegate protocol. but
-(void)findTask:(AGSFindTask *)findTask operation:(NSOperation *)op didExecuteWithFindResults:(NSArray *)results is never used.

line i use to execute the find task is

[self.findTask executeWithParameters:self.findParams];

edit: its fixed. method is called. seems like i was setting my layerids array wrong.
0 Kudos
NimeshJarecha
Esri Regular Contributor
What did you change in the FindTaskDemo?

Regards,
Nimesh
0 Kudos
HamzaHaroon
Occasional Contributor
not much at all. only took out the callout templates. at first the method wasnt bieng called because i had the layerids array set to nil. right now im not getting any results, but the methods work.
0 Kudos
NimeshJarecha
Esri Regular Contributor
Good to know. I just posted question without looking at your edits.

Regards,
Nimesh
0 Kudos