Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 加载委托时警告窗口层次结构_Ios_Xcode_Delegates_Warnings_Hierarchy - Fatal编程技术网

Ios 加载委托时警告窗口层次结构

Ios 加载委托时警告窗口层次结构,ios,xcode,delegates,warnings,hierarchy,Ios,Xcode,Delegates,Warnings,Hierarchy,今天我更新了我的Xcode,并开始为新的iPhone5屏幕更新我的应用程序 我突然注意到,每次从屏幕A转到屏幕B,我都会收到这样的警告: 警告:试图在上显示 谁的视图不在窗口中 等级制度 自从我的应用程序的第一个版本以来,我就没有接触过这个,所以我不确定这里会发生什么 我环顾了一下网络,有些人谈论将代码从viewDidLoad移动到ViewEmbeen,但我认为这不适用于这种情况。我已经找到了答案 我的问题是,在某个点上,我犯了一个错误,即在原始(正确)segue事件的基础上连接了内部补漆事件:

今天我更新了我的Xcode,并开始为新的iPhone5屏幕更新我的应用程序

我突然注意到,每次从屏幕A转到屏幕B,我都会收到这样的警告:

警告:试图在上显示 谁的视图不在窗口中 等级制度

自从我的应用程序的第一个版本以来,我就没有接触过这个,所以我不确定这里会发生什么

我环顾了一下网络,有些人谈论将代码从viewDidLoad移动到ViewEmbeen,但我认为这不适用于这种情况。

我已经找到了答案

我的问题是,在某个点上,我犯了一个错误,即在原始(正确)segue事件的基础上连接了内部补漆事件:

现在我把它修好了:


它又正常工作了。

事实上可能与viewDidLoad与ViewDidDisplay有关:已设置动画,因为当视图已加载时,它还不一定在层次结构中。尝试将presentViewController代码移动到ViewWillDisplay:animated并查看发生了什么…您好,点击按钮时将执行prepareForSegue方法。我不是从任何viewDid方法或任何其他地方手动调用。这是一个“UIStoryboardSegue”
// This delegate method prepares the segue from Screen A (DilemmaViewController) to Screen B (OptionsViewController)
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Executes the following "if" statement if the user wants to add new options
    if ([segue.identifier isEqualToString:@"AddOptions"]) 
    {
        UINavigationController *navigationController = segue.destinationViewController;
        OptionsViewController *controller = (OptionsViewController *)navigationController.topViewController;
        controller.delegate = self;

        // If the user has already put some inputs on the form we send them through the segue
        if ([edit count] > 0){            
            controller.edit = edit;
        }            
    }
}