Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/97.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.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 Unwind segue似乎取消分配我的视图对象_Ios_Objective C_Segue - Fatal编程技术网

Ios Unwind segue似乎取消分配我的视图对象

Ios Unwind segue似乎取消分配我的视图对象,ios,objective-c,segue,Ios,Objective C,Segue,我正在尝试使用“展开”序列传递对象。“我的按钮”成功展开,但视图中的所有对象都已重新初始化或执行其他操作。我使用prepareForSegue方法成功地准备对象,但当我通过操作按钮访问目标序列中的viewController时,所有对象要么重新初始化,要么未分配 我在这方面是新手,所以任何建议都将不胜感激!这是令我吃惊的代码 //在我试图从中释放的视图控制器中调用prepareForSegue - (void)prepareForSegue:(UIStoryboardSegue *)segue

我正在尝试使用“展开”序列传递对象。“我的按钮”成功展开,但视图中的所有对象都已重新初始化或执行其他操作。我使用prepareForSegue方法成功地准备对象,但当我通过操作按钮访问目标序列中的viewController时,所有对象要么重新初始化,要么未分配

我在这方面是新手,所以任何建议都将不胜感激!这是令我吃惊的代码

//在我试图从中释放的视图控制器中调用prepareForSegue

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"ReturnInput"])
    {

        GLUPipeDataController *dataController;
        dataController.length = [[NSNumber alloc] initWithFloat:1.5];
        self.dataController = dataController;
        [self.dataController print];
    }
}
//此操作在我的目标视图控制器中调用。通过控制将解除按钮拖动到连接面板上的退出例程,可以在IB中链接它。然后,我在文档大纲中更新了展开序列的名称

- (IBAction)done:(UIStoryboardSegue *)segue
{

    if ([[segue identifier] isEqualToString:@"ReturnInput"])
    {
        GLUEditViewController *editController = [segue destinationViewController];

        if (editController.dataController)
        {
            self.dataController = editController.dataController;
            [self.dataController print];
            [[self tableView] reloadData];
        }
    }
    if ([[segue identifier] isEqualToString:@"ReturnInserts"]) {
        GLUEditInsertsViewController *editInsertController = [segue destinationViewController];
        if (editInsertController.listInserts) {
            self.dataController.listInserts = editInsertController.listInserts;
            [[self tableView] reloadData];
        }
    }
}

PrepareForsgue prints属性中的调用[self.dataController print]。但是,done方法中的相同调用会打印一个新初始化的对象

调用done:get的方式、时间和地点?done:method中的代码实际上没有意义-代码应该位于展开segue的目标控制器中,因此segue.destinationViewController应该是self。此外,还不清楚通过操作按钮访问我的目标序列中的viewController是什么意思-什么视图控制器?什么按钮动作法?哇,太尴尬了!谢谢你,勒马尔!我真不敢相信我错过了。我将segue destinationViewController更改为segue sourceViewController,没有问题。