appunite / CLCascade

Twitter-like cascade UI library
http://appunite.com/
Other
505 stars 67 forks source link

UIViewControllerHierarchyInconsistency with iOS 5 #7

Closed bradleydwyer closed 13 years ago

bradleydwyer commented 13 years ago

Haven't dug into this, but it appears there is a problem running under iOS 5. The app crashes after attempting to open a 2nd level in the cascade view.

2011-07-27 22:21:49.001 Cascade[33686:ef03] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<ExampleTableViewController: 0x6898820> should have parent view controller:<CLCascadeNavigationController: 0x6a983e0> but actual parent is:<ExampleTableViewController: 0x6a3d9c0>'
*** First throw call stack:
(0x1198f1c 0x132b52e 0x113ad38 0x113acaa 0x220763 0x2209e9 0x226031 0x22031f 0x5215 0x3e41 0xeeed 0x106c8 0x27953e 0x27978f 0xa85e26 0x1168383 0x1169814 0x10c21e6 0x10c1750 0x10c1671 0x211a0c3 0x211a188 0x1e8c29 0x2949 0x28c5)
terminate called throwing an exception
chemicalweb commented 13 years ago

same problem.. i try to fix it but i think that is a conceptual problem.

grgcombs commented 13 years ago

Yes, I believe it has to do with modifying the parentViewController directly (against the rules). In iOS 5, the hierarchy backend changed quite a bit ... there's now something like addChildViewController ... in a sense, the way it's done in CLCascade is the hierarchical opposite of the way it's done in iOS 5

chemicalweb commented 13 years ago

How we can fix it? that problem needs to change the conceptual structure of CLCascade or i can substitute parentViewController with addChildViewController?

bradleydwyer commented 13 years ago

chemicalweb: Take a look at session 102 from the 2011 WWDC. It is the start of the answers you're looking for.

emilwojtaszek commented 13 years ago

The UIViewController class now allows you to define your own custom container view controllers and present content in new and interesting ways. Examples of existing container view controllers include UINavigationController, UITabBarController, andUISplitViewController. These view controllers mix custom content with content provided by one or more separate view controller objects to create a unique presentation for application content. Container view controllers act as a parent for their contained view controllers, forwarding important messages about rotations and other relevant events to their children.

BUT, current documentation is very poor, so I wait until it turns.

grgcombs commented 13 years ago

On the pre-release apple forums, a few folks have posted some demo code for the container methods.

g

ethanmick commented 13 years ago

On my fork, I've been playing around with iOS 5 code, and I added [self addChildViewController:viewController]; to the CLCascadeNavigationController in addViewController:sender:animated:.

Check out my fork and grab the code if you'd like. I'm not quite sure if we need to go about "removing" the child view controllers, or if when they get nil'ed out they stop being children.

emilwojtaszek commented 13 years ago

in master branch ios5 is now supported ;)