NSManagedObject

Undocumented

  • Mechanica

    If flag is true (default), the object won’t turn into a fault; instead, it’ll update the unchanged properties from the row cache, preserving any unsaved changes; if flag is false, the object will be forced to turn into a fault without merging and unsaved changes will be lost (which also causes other related managed objects to be released, so you can use this method to trim the portion of your object graph you want to hold in memory)

    Note

    Turning object into a fault means that strong references to related managed objects (that is, those to which object has a reference) are broken, so you can also use this method to trim a portion of your object graph you want to constrain memory usage.

    Declaration

    Swift

    public final func refresh(mergeChanges flag: Bool = true)

    Parameters

    flag

    only matters if the object has unsaved changes. In this case, a true value won’t turn the object into a fault; instead, it’ll update the unchanged properties from the row cache, preserving any unsaved changes. If flag is set to false, the object will be forced to turn into a fault, and unsaved changes will be lost.

  • Mechanica

    Returns the value of a persistent property that has been changed since last fetching or saving operation.

    Declaration

    Swift

    public final func changedValue(forKey key: String) -> Any?
  • Mechanica

    Returns of the last fetched or saved value of the propery specified by the given key.

    Declaration

    Swift

    public final func committedValue(forKey key: String) -> Any?