objective c - Should Reference to Core Data Object be Strong or Weak? -


i couldn't think of core data refer outside coredata. there no way there reference cycle. @ core data object points coredata objects.

however, may wrong.

managedobjectcontext not hold strong reference core data.

is there guide here?

is there guide here?

here link core data programming guide: object lifetime management.

it updated on july 2014, may have new information not published when asked question.

by default, though, references between managed object , context weak. means in general cannot rely on context ensure longevity of managed object instance, , cannot rely on existence of managed object ensure longevity of context. put way, just because fetched object doesn’t mean stay around.

the exception rule managed object context maintains strong reference changed

this means references nsmanagedobject subclasses (core data objects) should strong.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -