English 中文(简体)
利用目前的ModalViewController 装载观点
原标题:Using presentModalViewController to load a view

我试图装上另一个观点控制器的一位临时的幻灯片。 我的申请意见控制员的结构如下:

Application > Tab Bar Controller > TabBarItem > View Controller

在这种看法中,我有一个州,成功地用一种方法装载临时观点:

- (IBAction)displayTimePickerViewForDayButton:(id)sender {

    NSLog(@"displayTimePickerViewForDayButton method entered.");

    // create the selector view controller and become the delegate
    WOTimePickerViewController *tpvc = [[WOTimePickerViewController alloc] initWithNibName:@"WOTimePickerView" bundle:nil];
    tpvc.delegate = self;
    tpvc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

    [self presentModalViewController:tpvc animated:YES];
    [tpvc release];
}

我已经核实,我的WOtimePickerViewController正在从惯用法中成功地返回,但从来看,这种观点从未进入过。

因此,如果我看一看IB的意见,它似乎与“概览”财产有关。 当我对模拟器(来自IB)持有看法时,这种看法是正确的。

当我从XCODE处接手时,我可以浏览一下我方言,看上去了一个空白的白色屏幕(这并不是应该装上的那种看法的白色背景)。

最佳回答

你应该这样做。

WOTimePickerViewController *tpvc = [[WOTimePickerViewController alloc] initWithNibName:@"WOTimePickerView" bundle:nil];
    tpvc.delegate = self;
UINavigationController *navCntrlr = [[UINavigationController alloc] initWithRootViewController:tpvc];
    navCntrlr.modalTransitionStyle = UIModalTransitionStyleCoverVertical;

    [self.navigationController presentModalViewController:tpvc animated:YES];
    [tpvc release];

但你所缺少的重要事情是,你没有这样做。

请:

[self.navigationController presentModalViewController:tpvc animated:YES];

and when you want to dismiss the modalView controller 请:

[self.navigationController dismissModalViewControllerAnimated:YES];
问题回答

我认为,观点控制器的《电子传输标准》适用于该观点控制器显示的 。 因此,如果你想利用创新转变模式来显示你的模式控制器,那么你就应当把运输工具放在亲眼的控制器上,而不是把新的控制器上。

我没有使用“运输模式”的经验,但也许会确定,在装货之前,财产会造成一些问题? I d 试图就此发表意见......

象所有东西一样,在IB中都是正确的。 只要你们的档案所有人是观点控制者,其观点便应符合大家的意见。

希望,





相关问题
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风格的解决办法,只是一个简单的袖珍流程......

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

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

热门标签