Crash: _NSMetadataQueryResultArray objectAtIndex

Hello, sometimes if I use NSMetadataQuery to obervse my file changes on macOS, it crash for this reason, its odd and i have no clue for this problem becuse in my code I never get results using index, anyone help? thanks!

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[_NSMetadataQueryResultArray objectAtIndex:]: index (251625) out of bounds (251625)'
terminating with uncaught exception of type NSException
abort() called
  • I know the issue is maybe I’m trying to access an element at index is out of the bounds of the array, but how can I avoid this because in my code I never use an array.

Add a Comment

Replies

sometimes if I use NSMetadataQuery to obervse my file changes on macOS, it crash for this reason

Please post a full crash report. See Posting a Crash Report for hints on how to do that.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"