You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
optional relationships are nullable (makes sense!)
non-optional relationships are not nullable (does this make sense?)
In actuality, during deletion and tear down, even optional relationships get niled, and this can even be encountered during KVO observation. I have been bitten in the past assuming non-optional relationships are never nil.
Of course I can just use my own template, but we could consider changing the default template too.
Thanks for any thoughts on this...
The text was updated successfully, but these errors were encountered:
This is similar to the Garbage Collection Object Resurrection issue. The common case is you want non-optional to be non-nullable, expect for deletion, right?
For deletion, it may make sense to bypass the setters.
I don't have an exact example on hand, but I'm pretty sure I recall being surprised encountering required relationships being nil, probably during undo, redo, KVO, faulting, or something like that.
I've just tried Xcode's own ManagedObject codegen, and it seems to make all relationships nullable, be they optional or required relationships.
In
machine.h.motemplate
we have:i.e.:
In actuality, during deletion and tear down, even optional relationships get niled, and this can even be encountered during KVO observation. I have been bitten in the past assuming non-optional relationships are never nil.
Of course I can just use my own template, but we could consider changing the default template too.
Thanks for any thoughts on this...
The text was updated successfully, but these errors were encountered: