Multiple problems with UIPageViewController

Originator:steipete
Number:rdar://10941104 Date Originated:02/27/12
Status:Partly fixed in iOS6 ;) Resolved:
Product:iOS Product Version:5.0
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:

The UIPageViewController has some serious bugs. While integrating it with PSPDFKit, I had to add some crazy workarounds to NOT crash or hang the app, and it also breaks rotation of the whole app.

Steps to Reproduce:

Download the source code of PSPDFKit (note: this is a commercial framework and I grant you a temporary license for debugging, please do not share this link)

<<CENSORED>>
(I also attached the latest version of it here)

See how PSPDFPageViewController.m is implemented.

See the cruelty I had to add in

- (void)pageViewController:(UIPageViewController *)pageViewController didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray *)previousViewControllers transitionCompleted:(BOOL)completed

to cleanup after UIPageViewController's mess (e.g. pages got stuck, rotation got blocked).
I used some obfuscated private API to fix the problems, but I really want this to be fixed.

Remove the code and try the PSPDFKit Example with pageCurl enabled. Try on an iPad2. Try scrolling FAST, using the bottom bar. Eventually, a page hangs. Also see how rotation is now disabled, because Apple uses the secret beginDisablingInferfaceAutorotation. (why can't we have this API? It would be so much more convenient than overriding shouldRotate... and you have no idea how long it took me to find about about this...)

Next step, see the inhumanity in PSPDFPatch.m. Remove the calls, try on the device and watch how the app crashes because of a late animation trying to callback it's creator, then crashing badly because someone forgot nilling his delegates.

Ha, and please don't report my hacks to the AppStore review team ;)


Expected Results:

No crashes. No rotation stops. No frozen pages.

Actual Results:

All the mess above.

Regression:

No change, tried with iOS 5.0 - 5.1b3

Notes:

For further questions, just contact me at steipete@gmail.com or on Twitter, @steipete here.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!