Menu

#435 Persistence system needs a refactoring and cleanup

iphone_1.9
closed
nobody
None
5
2017-07-23
2017-07-16
No

1) Original implementation of the chain of persistence:
loop through view controller hierarchy
alloc + init next view controller
restore its persistent state (here is the recursion to the next level).
push or present it

2) Since iOS 3, some of the view-related states could not be restored before the view is available.
In these cases we modified the implementation:
loop through view controller hierarchy
alloc + init next view controller
restore part of its persistent state (here is the recursion to the next level).
push or present it
apply remaining part of its persistent state.

3) The current implementation as outlined in (2) is confusing; but worse, it is fragile.
We get warnings like "Presenting view controllers on detached view controllers is discouraged."
Actually, it is recommended to delay the presentation of the next view controller till viewWillAppear.

Discussion

  • Christa Runge

    Christa Runge - 2017-07-18

    Resolved in svn 3546, however following open issues:
    a) Single card from Card list, then Question
    b) Single card from card list, then select category
    c) Single card from Drill
    d) DB edit, rename database (this one is #436, and is resolved in svn 3549 / 3550).

     
  • Christa Runge

    Christa Runge - 2017-07-21

    Open issue (c) fixed in svn 3555.
    (a) and (b) are still open.

     
  • Christa Runge

    Christa Runge - 2017-07-23

    The broken scenario in detail:

    • open a databse, select a category, then select a single card and show its learning data. See the learning data of the card as expected.
    • exit and restart the application. See the learning data again as epected.
    • exit the application once more and restart application.
      Expected behaviour: see the learning data.
      Observed behaviour: see the card list.

    Similar behaviour for card / select categorie, and for the question or answer view after single card.

     
  • Christa Runge

    Christa Runge - 2017-07-23

    open issues (a) and (b) resolved in svn 3561.

     
  • Christa Runge

    Christa Runge - 2017-07-23
    • status: open --> closed
     
  • Christa Runge

    Christa Runge - 2017-07-23

    Tested on true device iPad Air 2 (iOS 11 beta) at svn 3563.
    The logic is correct.
    The animations for modal views are not perfect, I will open a separate tracker for this.

     

Log in to post a comment.