English 中文(简体)
• 利用国际商业行动装载一个没有尼亚布档案的观察台
原标题:Trying to use IBAction to load a ViewController that doesn t have a Nib file
  • 时间:2009-10-02 20:44:08
  •  标签:

我正试图把PantListTableViewController从我首页的一个顿装上。 我有一个禁忌的物品可以进入这一页。 然而,我希望从我起首页的纽芬兰语进入同一页,因为PantListTableViewController是一纸空文,在用户开始打开该页时,没有在表格上看到。 我怎么说?

代理主管档案包括:

@interface PatientListTableViewController : UITableViewController <PatientAddDelegate, NSFetchedResultsControllerDelegate, UINavigationBarDelegate, UITabBarControllerDelegate>{

事先得到任何帮助

代理主管档案包括:

@interface PatientListTableViewController : UITableViewController [PatientAddDelegate, NSFetchedResultsControllerDelegate, UINavigationBarDelegate, UITabBarControllerDelegate] {
最佳回答

如果你已经把这一看法控制员定为你的UITab BarController的副控制员,那么我要么使用setS selected Index:,要么在UITab BarController上使用。 如果你不这样做的话,你会再次提出问题,因为你可能把这种观点放在两个不同地点(在表格栏下,在你用人工装载时重新定位)。

这里有一些样本代码。 我假定,您的申请代表有一个实例变量:myTab BarController,并假设你将两个观点控制员重新置于UITab BarController:my FirstViewControllermy SecondViewController。 我推测,你把这两位观点控制者都归到你的国家银行档案中,把他们作为禁忌分子的儿童。

- (void)buttonPressed:(id)sender {
    [myTabBarController setSelectedViewController:mySecondViewController];
    // Alternately, you could set the index rather than the actual VC:
    // [myTabBarController setSelectedIndex:1]
}

如果你的问题与在没有国家银行档案的情况下装设一个观点控制器有关,确保你在这种看法中正确确定你的等级:控制器<代码>上载

问题回答

上述解决办法在我的第一号意见主计长执行该守则后,对我没有发挥作用:

import "MyFirstViewController.h"

import "MyAppDelegate.h"

@implementation MyFirstViewConller

@synthesize tab BarController;

  • (void)buttonPressed:(id)sender { [tabBarController setSelectedViewController:patientListController]

在我的MyAppDelegate.h档案中,我有:

IBOutlet UITabBarController *tabBarController; IBOutlet MyTableViewController *patientListController; .... end

在我的MyAppDelegate.m档案中,我有:

@implementation MyAppDelegate @synthesize patientListController;

@synthesize tab BarController; ... end

我是否在座谈什么?





相关问题