Discussion:
NSManagedObjectContext's undoManager is nil on macOS
Dave Fernandes
2018-09-06 02:33:03 UTC
Permalink
The docs say:
"In macOS, a context provides an undo manager by default; on iOS, the undo manager is nil by default.”

However, I am finding on macOS 10.13.6, the undoManager is always nil when creating a MOC. Is this new behavior expected for High Sierra, or is it a bug?
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@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/gegs%40ml-in.narkive.net

T
Jeff Nadeau
2018-09-06 19:56:32 UTC
Permalink
This behavior changed in 10.12 for applications linked against that SDK or later. It’s listed in the “Behavioral changes” section of the Core Data release notes for that year: https://developer.apple.com/library/archive/releasenotes/General/WhatNewCoreData2016/ReleaseNotes.html#//apple_ref/doc/uid/TP40017342-CH1-DontLinkElementID_10 <https://developer.apple.com/library/archive/releasenotes/General/WhatNewCoreData2016/ReleaseNotes.html#//apple_ref/doc/uid/TP40017342-CH1-DontLinkElementID_10>

There's a documentation bug to correct the information on the NSManagedObjectContext class doc. I’ll give it a little bump.

Going forward, you can set the undoManager property with your own NSUndoManager after you’ve initialized the context.

- Jeff
Post by Dave Fernandes
"In macOS, a context provides an undo manager by default; on iOS, the undo manager is nil by default.”
However, I am finding on macOS 10.13.6, the undoManager is always nil when creating a MOC. Is this new behavior expected for High Sierra, or is it a bug?
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/jnadeau%40apple.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@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/gegs%40ml-in.narkive.n
Dave Fernandes
2018-09-06 20:28:26 UTC
Permalink
Ah - thank you! I should read those release notes more carefully. Will close the bug I just filed.
Post by Jeff Nadeau
This behavior changed in 10.12 for applications linked against that SDK or later. It’s listed in the “Behavioral changes” section of the Core Data release notes for that year: https://developer.apple.com/library/archive/releasenotes/General/WhatNewCoreData2016/ReleaseNotes.html#//apple_ref/doc/uid/TP40017342-CH1-DontLinkElementID_10 <https://developer.apple.com/library/archive/releasenotes/General/WhatNewCoreData2016/ReleaseNotes.html#//apple_ref/doc/uid/TP40017342-CH1-DontLinkElementID_10>
There's a documentation bug to correct the information on the NSManagedObjectContext class doc. I’ll give it a little bump.
Going forward, you can set the undoManager property with your own NSUndoManager after you’ve initialized the context.
- Jeff
Post by Dave Fernandes
"In macOS, a context provides an undo manager by default; on iOS, the undo manager is nil by default.”
However, I am finding on macOS 10.13.6, the undoManager is always nil when creating a MOC. Is this new behavior expected for High Sierra, or is it a bug?
_
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@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/gegs%40ml-in.narkive.ne
Rick Mann
2018-09-06 20:31:38 UTC
Permalink
"although remember that both NSError** out parameters and exceptions are autoreleased and do not escape block lexical scope happily"

That statement needs to be linked to clarification.
Post by Jeff Nadeau
This behavior changed in 10.12 for applications linked against that SDK or later. It’s listed in the “Behavioral changes” section of the Core Data release notes for that year: https://developer.apple.com/library/archive/releasenotes/General/WhatNewCoreData2016/ReleaseNotes.html#//apple_ref/doc/uid/TP40017342-CH1-DontLinkElementID_10 <https://developer.apple.com/library/archive/releasenotes/General/WhatNewCoreData2016/ReleaseNotes.html#//apple_ref/doc/uid/TP40017342-CH1-DontLinkElementID_10>
There's a documentation bug to correct the information on the NSManagedObjectContext class doc. I’ll give it a little bump.
Going forward, you can set the undoManager property with your own NSUndoManager after you’ve initialized the context.
- Jeff
Post by Dave Fernandes
"In macOS, a context provides an undo manager by default; on iOS, the undo manager is nil by default.”
However, I am finding on macOS 10.13.6, the undoManager is always nil when creating a MOC. Is this new behavior expected for High Sierra, or is it a bug?
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/jnadeau%40apple.com
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
--
Rick Mann
***@latencyzero.com


_______________________________________________

Cocoa-dev mailing list (Cocoa-***@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/gegs%40ml-in.nar
Loading...