iphone 2.x sdk-对另一个viewController中显示为空的viewController的引用

iphone 2.x sdk-对另一个viewController中显示为空的viewController的引用,iphone,uiviewcontroller,reference,Iphone,Uiviewcontroller,Reference,我试图给一个新创建的自定义picker视图控制器实例一个对另一个viewController的引用,就像这样(这是在点击tableView行后调用的ponceViewController实例的选择器内部) 然后在我的timerPickerViewController实例中,我有: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWi

我试图给一个新创建的自定义picker视图控制器实例一个对另一个viewController的引用,就像这样(这是在点击tableView行后调用的ponceViewController实例的选择器内部)

然后在我的timerPickerViewController实例中,我有:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
  if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
    ...
    // ponceViewController is null here
    ... 
  }
}
timerPickerViewController显示得很好,我甚至可以在点击“完成”按钮后从ponceViewController访问内容,但我正在合成ponceViewController,它在我的标题和所有内容中,我似乎无法在timerPickerViewController的initWithNibName方法中访问它-它总是空的:(有人有什么想法吗

编辑:我还应该提到,在timerPickerViewController的viewDidLoad方法中,ponceViewController也是空的

- (void)viewDidLoad {
  ... no such thing as ponceViewController here! ...
}

因此,我通过完全删除
initWithNibName:(NSString*)nibNameOrNil bundle:(NSBundle*)修复了它nibBundleOrNil
来自timerPickerViewController,并使用了
viewDidLoad
。一切似乎都正常。我认为问题在于,在
initWithNibName
中引用该属性时,该属性还不可用。希望这对其他人有所帮助

- (void)viewDidLoad {
  ... no such thing as ponceViewController here! ...
}