开发者

splitview with multiple detail views and navcontroller only works once

开发者 https://www.devze.com 2023-02-25 20:03 出处:网络
I used the Apple splitview with multiple detail views example. I have several different detail views, som开发者_StackOverflow社区e of them have navigationcontrollers, so I can do a pushViewController

I used the Apple splitview with multiple detail views example. I have several different detail views, som开发者_StackOverflow社区e of them have navigationcontrollers, so I can do a pushViewController to push a "settings page" for example. In the xib file I have to specify a specific detailview as the "Class" which happens to be the first detailView. When I run the program I am able to push a new view from the first detail view, but when I navigate away from the view by clicking on another detaiview then go back to the first detailView, the pushsubview doesn't work.

Note:If I do this with just 1 detailviewcontroller this works fine. Something seems to get disconnected when I change to multiple detailviewcontrollers


It sounds like your navigationController is getting deallocated. Put this statement before the "push" to find out:

   NSLog(@" Navigation Controller is 0x%x",myNavigationController);

If it reports "0x0", then you need to keep a reference to your navController somewhere so it stays around.

0

精彩评论

暂无评论...
验证码 换一张
取 消