我的应用程序无法在 iOS5 上运行
由于新版本的 iOs 第 5 版,我正在努力处理我的应用程序...
我可以正常启动应用程序,但当我单击 tabBar 项目或按钮时,它会崩溃。我编写了异常的代码以及它可以运行的视图的代码:)
它适用于每个目标,但在 ios5 上崩溃。有什么想法吗?
* 由于未捕获的异常“UIViewControllerHierarchyInconsistency”而终止应用程序,原因:“子视图” 控制器:应该有父视图 控制器:但实际的父级 是:'
@implementation PortCIAViewController
@synthesize tabBarController,topHeader,myApp;
- (void)viewDidLoad {
[super viewDidLoad];
tabBarController.view.frame = CGRectMake(0, 30, 320, 430);
[self.view addSubview:tabBarController.view];
//self.view = tabBarController.view;
}
- (void)tabBarController:(UITabBarController *)tabBarControllerA didSelectViewController:(UIViewController *)viewController{
if(tabBarControllerA.selectedIndex==4){
[(PortCIAAppDelegate*)myApp activeFullScreen];
if(([(OrariViewController *)viewController segmentControllOrari].selectedSegmentIndex)==-1){
[(OrariViewController *)viewController segmentControllOrari].selectedSegmentIndex=0;
[(OrariViewController *)viewController segmentControllFascie].selectedSegmentIndex=[OrariViewController getCorrectFasciaOraria];
}
}
else{
[(PortCIAAppDelegate *)myApp deactiveFullScreen];
}
}
- (void)dealloc {
[tabBarController release];
[myApp release];
[topHeader release];
[super dealloc];
}
@end
I'm struggling with my application due to the new version of iOs the 5th one...
I can launch the application normally but when I click on a tabBar item or on a button it crashes. I write the code of the exception plus the code of the view it can run :)
It works on every target but it crashes on ios5. Any idea?
* Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view
controller: should have parent view
controller: but actual parent
is:'
@implementation PortCIAViewController
@synthesize tabBarController,topHeader,myApp;
- (void)viewDidLoad {
[super viewDidLoad];
tabBarController.view.frame = CGRectMake(0, 30, 320, 430);
[self.view addSubview:tabBarController.view];
//self.view = tabBarController.view;
}
- (void)tabBarController:(UITabBarController *)tabBarControllerA didSelectViewController:(UIViewController *)viewController{
if(tabBarControllerA.selectedIndex==4){
[(PortCIAAppDelegate*)myApp activeFullScreen];
if(([(OrariViewController *)viewController segmentControllOrari].selectedSegmentIndex)==-1){
[(OrariViewController *)viewController segmentControllOrari].selectedSegmentIndex=0;
[(OrariViewController *)viewController segmentControllFascie].selectedSegmentIndex=[OrariViewController getCorrectFasciaOraria];
}
}
else{
[(PortCIAAppDelegate *)myApp deactiveFullScreen];
}
}
- (void)dealloc {
[tabBarController release];
[myApp release];
[topHeader release];
[super dealloc];
}
@end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论