mamaral / Onboard

An iOS framework to easily create a beautiful and engaging onboarding experience with only a few lines of code.
MIT License
6.46k stars 765 forks source link

When I run Onboard, an error has occurred #52

Closed lizhaodong closed 9 years ago

lizhaodong commented 9 years ago

The environment:iOS7.1+iphone4s * Assertion failure in -[_UIQueuingScrollView _replaceViews:updatingContents:adjustContentInsets:animated:], /SourceCache/UIKit/UIKit-2935.138/_UIQueuingScrollView.m:383 2015-06-08 18:00:08.856 Onboard[442:60b] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: [views count] == 3' *\ First throw call stack: (0x2d88cf83 0x3803dccf 0x2d88ce5d 0x2e23ad5b 0x3060ab99 0x3060da75 0x3060a1a9 0x300a9d59 0x2fd2762b 0x2fd22e3b 0x2fd22ccd 0x2fd226df 0x2fd224ef 0x2fd1c21d 0x2d858255 0x2d855bf9 0x2d855f3b 0x2d7c0ebf 0x2d7c0ca3 0x326c6663 0x3010d14d 0x996d1 0x3854aab7) libc++abi.dylib: terminating with uncaught exception of type NSException。

Some helpful information online: http://stackoverflow.com/questions/14220289/removing-a-view-controller-from-uipageviewcontroller http://stackoverflow.com/questions/20004310/invalid-parameter-exception-thrown-by-uiqueuingscrollview

lizhaodong commented 9 years ago

shielding OnboardingContentViewController.m code line 129 of "self viewDidAppearBlock ()" , the program will not go wrong

mamaral commented 9 years ago

Thanks for the info! Do you have steps to reproduce this?

lizhaodong commented 9 years ago

@mamaral: After the start process, continuously in the interface between the slide switch, this bug will appear after a lot of time。

lizhaodong commented 9 years ago

I have updated the latest code, but also to the bug. Repeat steps:In the first interface and the second interface between continuous switching,then appear it. Popup animation caused this bug。

mamaral commented 9 years ago

Awesome, I was able to reproduce it reliably and also do some research on it... It looks like a UIKit bug and appears to manifest when scrolling between view controllers in a UIPageViewController while also displaying a UIAlertView. Honestly, there's probably nothing I can do other than file a radar with Apple, unless I'm missing something. If you just don't implement anything like an alert view in the viewDidAppear block, you should be fine.

mamaral commented 9 years ago

Scratch that, I may have found a workaround on my end... Hold please...

mamaral commented 9 years ago

It looks like https://github.com/mamaral/Onboard/commit/7812b2d7178602c0d9b144fde21e7a0a5f94bb25 fixes that issue. I pushed version 2.1.4 to CocoaPods, so when you're able to pull the newest version let me know if the problem goes away.

lizhaodong commented 9 years ago

I have updated the latest code, it`s very good the problem goes away.

mamaral commented 9 years ago

Awesome, thanks for your help!