I have a program which runs fine, except for the days it does not. I then creates an exception like: "*** -[NSMetadataQuery resultAtIndex:]: index (454) out of bounds (0)".
The culprit is always NSMetadataQuery resultAtIndex:. The problem: when I start to debug, this exception soon goes away. When I give up, it will reappear sooner or later. The backtrace is not always the same, but always there is an NSArrayController, NSTableBinder, NSTableView, NSArrayController again, until NSMetadataQuery resultAtIndex: with an invalid index. (See below for one example). Any ideas what to do? How to make this bug raise it's ugly head? How to fix it? 26/08/2013 07:03:43.817 Digital Librarian[12418]: ( 0 CoreFoundation 0x00007fff8b9dcb06 __exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff8d4443f0 objc_exception_throw + 43 2 CoreFoundation 0x00007fff8b9dc8dc +[NSException raise:format:] + 204 3 Foundation 0x00007fff8ed46f99 -[NSMetadataQuery resultAtIndex:] + 184 4 AppKit 0x00007fff91aaef9c -[_NSModelObservingTracker stopObservingModelObjectAtReferenceIndex:] + 161 5 AppKit 0x00007fff91aaed5d -[_NSModelObservingTracker stopObservingModelObjectsAtReferenceIndexes:] + 188 6 AppKit 0x00007fff91a7180a -[NSArrayController _selectObjectsAtIndexesNoCopy:avoidsEmptySelection:sendObserverNotifications:forceUpdate:] + 416 7 AppKit 0x00007fff91b98589 -[NSArrayController _modifySelectedObjects:useExistingIndexesAsStartingPoint:avoidsEmptySelection:addOrRemove:sendObserverNotifications:forceUpdate:] + 976 8 AppKit 0x00007fff918bbd61 -[NSArrayController setSelectedObjects:] + 47 9 Digital Librarian 0x000000010000d819 -[TableHandler setIndices:] + 73 10 Digital Librarian 0x000000010000dfb7 -[TableHandler(TableHandlerPrivate) tableViewSelectionDidChange:] + 1863 11 CoreFoundation 0x00007fff8b98eeda _CFXNotificationPost + 2554 12 Foundation 0x00007fff8ed7f7b6 -[NSNotificationCenter postNotificationName:object:userInfo:] + 64 13 AppKit 0x00007fff91aac260 -[NSTableView _sendSelectionChangedNotificationForRows:columns:] + 176 14 AppKit 0x00007fff91a9142c -[NSTableView _enableSelectionPostingAndPost] + 411 15 AppKit 0x00007fff91a90382 -[NSTableView _verifySelectionIsOK] + 1194 16 AppKit 0x00007fff91a77e1d -[NSTableView _tileAndRedisplayAll] + 350 17 AppKit 0x00007fff91b16040 -[NSTableBinder _updateContent] + 275 18 AppKit 0x00007fff91b15e47 -[NSTableBinder _observeValueForKeyPath:ofObject:context:] + 84 19 AppKit 0x00007fff91b15c58 -[NSTableBinder observeValueForKeyPath:ofObject:change:context:] + 63 20 Foundation 0x00007fff8edc27b7 NSKeyValueNotifyObserver + 390 21 Foundation 0x00007fff8edbcc65 -[NSObject(NSKeyValueObservingPrivate) _notifyObserversForKeyPath:change:] + 967 22 AppKit 0x00007fff91a71df3 -[NSController _notifyObserversForKeyPath:change:] + 209 23 AppKit 0x00007fff91a71c3e -[NSArrayController didChangeValuesForArrangedKeys:objectKeys:indexKeys:] + 54 24 AppKit 0x00007fff91a8b4de -[NSArrayController setContent:] + 878 25 AppKit 0x00007fff91a8acb8 -[NSArrayDetailBinder _refreshDetailContentInBackground:] + 1268 26 Foundation 0x00007fff8edc466d -[NSKeyValueObservance observeValueForKeyPath:ofObject:change:context:] + 304 27 Foundation 0x00007fff8edc27b7 NSKeyValueNotifyObserver + 390 28 Foundation 0x00007fff8edc41c1 NSKeyValueDidChange + 456 29 Foundation 0x00007fff8ed7f76a -[NSObject(NSKeyValueObserverNotification) didChangeValueForKey:] + 118 30 Foundation 0x00007fff8ed44e31 -[NSMetadataQuery _recreateQuery] + 421 31 Digital Librarian 0x00000001000075b1 -[SpoDelegate(SpoDelegatePrivate) startQueryFor:] + 769 32 Digital Librarian 0x00000001000022cd -[SpoDelegate searchTextDone:] + 141 33 AppKit 0x00007fff91a31959 -[NSApplication sendAction:to:from:] + 342 34 AppKit 0x00007fff91a317b7 -[NSControl sendAction:to:] + 85 35 AppKit 0x00007fff91b13ee0 -[NSTextField textDidEndEditing:] + 691 36 CoreFoundation 0x00007fff8b98eeda _CFXNotificationPost + 2554 37 Foundation 0x00007fff8ed7f7b6 -[NSNotificationCenter postNotificationName:object:userInfo:] + 64 38 AppKit 0x00007fff9183d469 -[NSTextView(NSPrivate) _giveUpFirstResponder:] + 443 39 AppKit 0x00007fff9183d296 -[NSTextView(NSKeyBindingCommands) insertNewline:] + 555 40 AppKit 0x00007fff9183cf6c -[NSResponder doCommandBySelector:] + 75 41 AppKit 0x00007fff9183cdce -[NSTextView doCommandBySelector:] + 197 42 AppKit 0x00007fff918bfe6e -[NSKeyBindingManager(NSKeyBindingManager_MultiClients) interpretEventAsCommand:forClient:] + 2200 43 AppKit 0x00007fff918bf2db -[NSTextInputContext handleEvent:] + 939 44 AppKit 0x00007fff918beea7 -[NSView interpretKeyEvents:] + 183 45 AppKit 0x00007fff9180bc57 -[NSTextView keyDown:] + 723 46 AppKit 0x00007fff91a27020 -[NSWindow sendEvent:] + 9687 47 AppKit 0x00007fff91a22644 -[NSApplication sendEvent:] + 5761 48 AppKit 0x00007fff9193821a -[NSApplication run] + 636 49 AppKit 0x00007fff918dcbd6 NSApplicationMain + 869 50 Digital Librarian 0x0000000100001dc2 main + 34 51 Digital Librarian 0x0000000100001d94 start + 52 52 ??? 0x0000000000000003 0x0 + 3 ) _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com