What is the state of a "rollbacked" managed object?

  • Hi list,

    I have a bug in my application and don't really know how to solve it:

    Suppose my program follows the steps:

    1/ save the moc
    2/ insert a managed object
    3/ the user can edit the managed object (attributes mostly)
    4/ the user can validate or cancel via a button.
    5/ when validating via OK button, the MOC is saved. When cancelling
    via Cancel button, the MOC is sent a rollback message.

    I *thought* that after the rollback, the managed object would be
    deleted (at least would return YES to isDeleted message).
    Unfortunately it is not the case: the managed object still exists, is
    in "no state" (not inserted, nor deleted) and all its attributes/
    relationship are nullified.
    Rollback is supposed to return the MOC to its previous state. I
    noticed that the managed object is "detached", it has no MOC.

    can someone describe me what really happens to this managed object ?
    is it supposed to be deleted ? detached from the MOC (then freed ?
    when ?)

    Thanks for any help.

    Aurélien,
    Objective Decision Team
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today