Reputation: 713
I am getting this error "The operation couldn’t be completed. (CSIndexErrorDomain error -1005.)"
while running code for spotlight search on ipad.Does anyone know how to solve this error?
Upvotes: 6
Views: 1419
Reputation: 349
Since the Search feature is not available on all the devices supporting iOS9 so check the following condition to know whether the device supports search
if ([CSSearchableIndex isIndexingAvailable])
and keep the methods of search under this condition.
Upvotes: 10
Reputation: 681
The CoreSpotlight is available on iOS 9 onwards.
Though your device maybe at iOS 9.x, it still may not work if it is a older device version.
From Apple docs.
Although app search is available for iOS 9 users, the search functionality of NSUserActivity and Core Spotlight is not supported on iPhone 4s, iPad 2, iPad (3rd generation), iPad mini, and iPod touch (5th generation)."
So if you are testing on any of the above devices or simulators for the same you will get the CSIndexErrorDomain error -1005.
From Corespotlight API documentation
CSIndexErrorCodeIndexingUnsupported = -1005, //Indexing isn't supported on this device
Upvotes: 23