defagos / CoconutKit

CoconutKit is a productivity framework for iOS, crafted with love and focusing on ease of use
Other
1.15k stars 111 forks source link

Double calls viewWillAppear/viewDidAppear on iOS5 #4

Closed iomark closed 12 years ago

iomark commented 12 years ago

Environment: Xcode 4.2, iOS SDK 5.0, iPad 5.0 Simulator, CoconutKit 1.1.1

Steps for reproducing: 1) start CoconutKit-dev in iPad Simulator; 2) select HLSPlaceholderViewController; 3) tap "Hide with modal" 4) tap "Close" in appeared modal controller.

Actual result: two pairs viewWillAppear/viewDidAppear. Expected result: one viewWillAppear and one viewDidAppear.

2012-02-16 16:49:41.008 CoconutKit-dev[14824:15203] [INFO] (-[LifeCycleTestViewController viewWillDisappear:]) - Called for object <LifeCycleTestViewController: 0x8b37770>, animated = YES
2012-02-16 16:49:41.412 CoconutKit-dev[14824:15203] [INFO] (-[LifeCycleTestViewController viewDidDisappear:]) - Called for object <LifeCycleTestViewController: 0x8b37770>, animated = YES
2012-02-16 16:50:03.485 CoconutKit-dev[14824:15203] [INFO] (-[LifeCycleTestViewController shouldAutorotateToInterfaceOrientation:]) - Called, toInterfaceOrientation = UIInterfaceOrientationPortrait
2012-02-16 16:50:03.486 CoconutKit-dev[14824:15203] [INFO] (-[HLSContainerContent addViewToContainerView:inContainerContentStack:]) - View controller's view already added to a container view
2012-02-16 16:50:03.487 CoconutKit-dev[14824:15203] [INFO] (-[LifeCycleTestViewController viewWillAppear:]) - Called for object <LifeCycleTestViewController: 0x8b37770>, animated = YES
2012-02-16 16:50:03.488 CoconutKit-dev[14824:15203] [INFO] (-[LifeCycleTestViewController viewWillAppear:]) - Called for object <LifeCycleTestViewController: 0x8b37770>, animated = YES
2012-02-16 16:50:03.491 CoconutKit-dev[14824:15203] [INFO] (-[LifeCycleTestViewController viewDidAppear:]) - Called for object <LifeCycleTestViewController: 0x8b37770>, animated = YES
2012-02-16 16:50:03.891 CoconutKit-dev[14824:15203] [INFO] (-[LifeCycleTestViewController viewDidAppear:]) - Called for object <LifeCycleTestViewController: 0x8b37770>, animated = YES
defagos commented 12 years ago

This is a known iOS 5 issue (documented in the HLSStackController header and in the README file). I already filed a bug report for it: http://openradar.appspot.com/10822029. Thanks for the feedback anyway.

defagos commented 12 years ago

Fixed in commit 5bd12e8ad0ec9e79c710909ca9b7bf858c4b46b4

This was not an iOS 5 bug, but a hidden behavior of addChildViewController:. I should file a radar for lack of documentation, I think :-)