English 中文(简体)
由于SOS4.3及以上不履约,增加了空白面孔控制器页。
原标题:blank rootviewcontroller page is added by default from iOS 4.3 and above

我的申请是,我使用导航控制器,使用海关电算师提供等级数据。 然而,在我们的具体应用中,我们需要在每一页都有一个带子,让用户回到根基控制器网页。 为实现这一目的,我在所有海关观察控制人员中确定了一种发射方法,即:

- (void) launchHomePage {
    [self.navigationController popToRootViewControllerAnimated:NO];
}

这完全是在SOS 4.2。 然而,在SOS4.3和Si05中,当家 but被点击时,它就显示一张空白表。 为了辩论这个问题,我试图看到导航管理员的电离辐射员名单,然后打电话叫PpopToRootViewController Animated。

- (void) launchHomePage {

    if(self.navigationController) {

        [self printViewControllers:[self.navigationController viewControllers]];

        [viewController.navigationController popToRootViewControllerAnimated:NO];

    } else {
        NSLog(@"Couldn t retrieve navigationcontroller
");
    }
}

- (void) printViewControllers:(NSArray *) viewControllers {

    if(viewControllers) {
        NSLog(@"Number of viewcontrollers in navigationController s array is %d
", 
              [viewControllers count]);

        int i = 1;
        for(UIViewController *viewController in viewControllers) {
            NSLog(@"viewController %d is %@ and has title %@
", i++, viewController, [viewController title]);
        }
    }
}

对于同一执行顺序,以下是上述方法在OS5.0和OS.4.2中的输出:

iOS5:

Number of viewcontrollers in navigationController s array is 3
viewController 1 is <RootViewController: 0x86259c0> and has title (null)
viewController 2 is <RootViewController: 0x9115680> and has title MainPage
viewController 3 is <FirstPageViewController: 0x9141bd0> and has title FirstPage


iOS4.2:
Number of viewcontrollers in navigationController s array is 2
viewController 1 is <RootViewController: 0x624d520> and has title MainPage
viewController 2 is <FirstPageViewController: 0x651ce10> and has title FirstPage

I am not able to figure out how/why there is a blank page (with title null) as the root of the navigationController. Appreciate any help in figuring this out.

问题回答

我也存在同样的问题,我认为这个问题与使用轴心文件装载UINavigationController有关,但我没有能够证实。 不管怎么说,我原来都这样做(纳夫控制员是从轴心档案中装载的UINavigationController,因此,我 t了它,因为我认为轴心档案确实如此:

[navController initWithRootViewController:rootController];

I replaced it with this

navController = [[UINavigationController alloc] initWithRootViewController:rootController];

以及PopotViewController方法现在与原先的做法一样运作,SOS4.3和OS5。 我还对SOS3.1.3进行了测试,并按预期进行。





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签