【问题标题】:UINavigationController / reloading views / working with views!UINavigationController / 重新加载视图 / 使用视图!
【发布时间】:2011-03-21 21:16:06
【问题描述】:

我有一个使用 UINavigationController 的基于视图的项目。

RootViewController 在创建新条目时执行写入数据模型的操作。

我的主屏幕上有一个添加 (+) 按钮,用于添加带有时间戳的条目并将其记录到数据模型中。

我想单击添加按钮,浏览资产列表,并记录一个包含资产 URL 的条目,以便我可以播放资产。

我点击添加按钮,然后像这样启动一个新的 XIB:

pickerViewController = [[MyPickerViewController alloc] 
initWithNibName:@"MyPickerViewController" bundle:nil];

//---set the property of the second view with the DatePicker view in the                current          view---
pickerViewController.myURL = importVideoURL;    

然后,一旦我获取了我想与我的条目一起存储的关联资产 URL,我从超级视图中删除视图以返回我的主视图,使用:

[self.view removeFromSuperview]

我的问题:我无法找到任何通知或方法,例如 viewDidAppear 等,让我可以在我的 rootViewController 中继续执行,我可以在其中编写条目。

我错过了什么?

哈哈!

【问题讨论】:

    标签: iphone xcode uiview uiviewcontroller uinavigationcontroller


    【解决方案1】:

    您将需要阅读 Apple 的 navigation controller documentation 并通过推送和弹出视图控制器进行工作。当您从堆栈中弹出选择器视图控制器时,您可以在根视图控制器中调用 -viewDidAppear: 以继续进行数据模型更新。

    【讨论】:

    • 我会检查这个并在我确认后标记,虽然这听起来像是正确的路径,谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-06-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-23
    相关资源
    最近更新 更多