Suppress log: "Cannot perform operation without a managed object context"
Suppress log: "Cannot perform operation without a managed object context"
- Subject: Suppress log: "Cannot perform operation without a managed object context"
- From: Jerry Krinock <email@hidden>
- Date: Thu, 10 Apr 2014 15:23:31 -0700
In Mac app, a Preferences window nib contains an object controller in Entity mode, which is bound to the managed object context of a Core Data document. I realize this is kind of haywired, but please just accept that real life is sometimes a little messy.
In normal operation, a document is always open. But if a document cannot be opened, and if user opens Preferences during the dialog warning of this failure, of course, that binding fails. The controls which are bound to the unavailable managed object context via the object controller are disabled; other controls work OK. That’s good. The only problem is that the message and stack trace from an exception (see below) are logged.
Can anyone think of a way to prevent the logging of this? The stack trace appears to be all Apple non-public API, and this little issue is not worth a hack. I don’t want to disable opening of the Preferences window until a document is available, because that would be illogical and overkill, and the user may want to peek at prefs for some reason.
Thanks
Jerry Krinock
2014-04-10 14:44:09.937 Testy[4544:303] Cannot perform operation without a managed object context
2014-04-10 14:44:09.945 Testy[4544:303] (
0 CoreFoundation 0x00007fff91cfa25c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff8b33ae75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff91cfa10c +[NSException raise:format:] + 204
3 AppKit 0x00007fff8cabf703 -[_NSManagedProxy _managedObjectContext] + 66
4 AppKit 0x00007fff8cabf67c -[_NSManagedProxy _persistentStoreCoordinator] + 22
5 AppKit 0x00007fff8cabf5f9 -[_NSManagedProxy _entity] + 46
6 AppKit 0x00007fff8cabf515 -[_NSManagedProxy fetchRequestWithSortDescriptors:limit:] + 95
7 AppKit 0x00007fff8cd0f8fb -[NSObjectController(NSManagedController) _executeFetch:didCommitSuccessfully:actionSender:] + 73
8 AppKit 0x00007fff8ceea846 _NSSendCommitEditingSelector + 267
9 AppKit 0x00007fff8cb93f78 -[NSController _controllerEditor:didCommit:contextInfo:] + 182
10 CoreFoundation 0x00007fff91be5a5c __invoking___ + 140
11 CoreFoundation 0x00007fff91be58c4 -[NSInvocation invoke] + 308
12 CoreFoundation 0x00007fff91c88516 -[NSInvocation invokeWithTarget:] + 54
13 Foundation 0x00007fff8dd6dcb7 __NSFireDelayedPerform + 333
14 CoreFoundation 0x00007fff91c61494 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
15 CoreFoundation 0x00007fff91c60fcf __CFRunLoopDoTimer + 1151
16 CoreFoundation 0x00007fff91cd25aa __CFRunLoopDoTimers + 298
17 CoreFoundation 0x00007fff91c1c755 __CFRunLoopRun + 1525
18 CoreFoundation 0x00007fff91c1bf25 CFRunLoopRunSpecific + 309
19 HIToolbox 0x00007fff89443a0d RunCurrentEventLoopInMode + 226
20 HIToolbox 0x00007fff894437b7 ReceiveNextEventCommon + 479
21 HIToolbox 0x00007fff894435bc _BlockUntilNextEventMatchingListInModeWithFilter + 65
22 AppKit 0x00007fff8c75226e _DPSNextEvent + 1434
23 AppKit 0x00007fff8c7518bb -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 122
24 AppKit 0x00007fff8c7459bc -[NSApplication run] + 553
25 AppKit 0x00007fff8c7307a3 NSApplicationMain + 940
26 Testy 0x00000001000027bf main + 367
27 Testy 0x0000000100001b34 start + 52
28 ??? 0x0000000000000003 0x0 + 3
)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden