baker icon indicating copy to clipboard operation
baker copied to clipboard

mutating method sent to immutable object

Open psmedia opened this issue 15 years ago • 12 comments

After downloading latest build of baker master branch, I am getting the following error when I've been a bit rough with the app, ie, scrolling through pages quickly, double clicking the on the index.html quickly, etc.

"Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object'"

But I'm not sure what method we are sending to what object... Apologies

psmedia avatar Aug 31 '11 08:08 psmedia

Hi! :)

That's new, but I think it's going to be fixed during our current work on master - I hope, since we are working on pagination and caching. Wait for the next commit and check it again ;)

folletto avatar Aug 31 '11 09:08 folletto

OK, there's a new commit, try it out. :)

folletto avatar Aug 31 '11 11:08 folletto

(Before reading my post, please notice that I'm using iOS 5.0 beta 4.)

I just tried the latest master (g7e4c923) with the book-folder of one of my apps. It seems that a JS-animation (made in Hype) on the next page is already being activated when the current page is still being viewed. Also an audio file (mp3) keeps playing when you're swiping to the next page. I guess this is the same with a video file.

Also this version still seems to feel a pretty buggy when you're being 'rough' with scrolling and stuff, like @psmedia said. Sometimes a page freezes and can't be scrolled vertically. You can only swipe to the next or previous page. When you swipe back to the frozen page it seems to recover itself and is working again.

In the version of 2011-08-04 I was able to scroll pages very quickly, but now that seems to be disabled? Now there's some kind of blocking for about a second before you can swipe again. Good thing is, I'm not seeing a loading page anymore :)

Also found out that "#define PAGE_VERTICAL_BOUNCE NO" doesn't seem to work anymore. When set to NO, it still bounces.

Overall I think the version of 2011-08-04 was a lot more stable.

I hope you guys can use this feedback! :)

If you want to use my book-folder for testing, I can provide it for testing purposes.

danielbenjamins avatar Aug 31 '11 17:08 danielbenjamins

Well, we can't say for sure about stability until we finalize it. ;)

However, what version are you testing? The last master committed today? This master caches the pages, so after the first time, any subsequent load should be incredibly fast. :)

folletto avatar Aug 31 '11 17:08 folletto

Using commit 7e4c923 on iOS 4.3.5 iPad1 and 4.3 on simulator.

Good News: I can't reproduce the bug.

Bad News: the page "snapshots" are not working very well for me. If I understand properly (and please forgive me if I have wrong end of stick), this commit of Baker takes a snapshot of a page, displays that in locked form, then unlocks it when all the html has loaded. A couple different problems show themselves:

  • sometimes the scrolling to next page seems disabled, as does doubletap to call index.html. So you are stuck on a page with no way out. This is not a crash. I notice this in particular on pages with large single images
  • the snapshot stays on screen too long, with the result that user gets confused - tapping on icon or swiping elements that do not respond. The "real" page does load afterwards, but there's no signal to tell user when she has shifted from "snapshot" to live page. Actually, if this delay is ever going to be more than 0.2 seconds, I would rather have the "page loading" message, short delay, and then load a live page that will respond as user expects.

We grateful Baker users can design our html to accommodate whatever delays are inherent in the Framework. I know you guys are working hard to increase speed of page load but at this particular moment the cost of improvements seems a bit high.

Look forward to seeing how you move from here, and thanks - as always - for a great tool!

psmedia avatar Sep 01 '11 01:09 psmedia

Uhm I'll ping Xmas on that, he was working on the feature...

folletto avatar Sep 01 '11 10:09 folletto

Hi,

actually is not the snapshot that is "locked", is the page, let me explain: • when the snapshots aren't available each time a page is loaded then it's locked in place to give the application the time to snapshot it.

• when the snapshots it's taken it's attached to the background and remain there, the page is unlocked and the user can resume the navigation as normal.

The locking of the page is why sometimes the page are unresponsive: if the context of the page change while the snapshot is taken the operation fails (usually a completely white or black image is the result).

So the "locking" is kinda mandatory, one possible solution may be to taken all the snapshot in advance (preloading all the page and taking snapshots before the book is shown) with the result of having a longer initialization but no delay during the navigation.

About the snapshot staying there to long ... well, that's the native time the webview take to load and render a page: the loading of the page start as soon as the scrolling animation finish, with no added delay, and it's natively managed by the webview component. I guess that, even with local content, the webview remains a bit slow.

Of course there's the "three card" flag: activating it disable the snaphot taking, no need of them if the previous and the next page are preloaded outside the screen, but there are other problems, like the on depicted on issue #122.

I hope this explain how Baker work now: we are really trying to improve the navigation and the snapshot seems like a good solution. Of course any idea or suggestion in this direction is appreciated :)

Xm4s avatar Sep 01 '11 14:09 Xm4s

Thanks very much Xmas for the clear explanation.

Shall I review this build again with a more clear focus on difference between 3card: YES and 3card:NO, or should I wait for your next commit? Certainly the delays with 3card:NO were way too long in my particular case.

Peter

psmedia avatar Sep 02 '11 03:09 psmedia

You should definitely try the three cards method, since the effort to do so is only to change that boolean flag. Be aware that we are still working on that, so every feedback or bug report is really appreciated.

Thank you :)

Xm4s avatar Sep 02 '11 08:09 Xm4s

Hi there psmedia. Have you managed to solve the issue?

Simbul avatar Sep 26 '11 20:09 Simbul

I haven't done exhaustive testing, but the new builds are performing very well, and I am no longer seeing this issue!

psmedia avatar Oct 02 '11 16:10 psmedia

Awesome! :D

folletto avatar Oct 02 '11 20:10 folletto