UINavigationController / 重新加载视图 / 使用视图!
我有一个基于视图的项目,与 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 中,在那里我可以编写 Entry。
我缺少什么?
哈尔普!
I have a view based project working with a UINavigationController.
The RootViewController performs operations for writing to a data model when a new entry is made.
I have an add (+) button on my main screen that adds an entry with a timestamp and records this to the data model.
I want to click the add button, browse a list of assets, and record an entry that includes an asset URL so I can play the asset.
I hit the add button, I then launch a new XIB as such:
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;
THEN, once I have grabbed the associated asset URL that I would like to store with my entry, I remove the view from the superview to get back to my main view using:
[self.view removeFromSuperview]
My Problem: I can in no way, find any notification or method like viewDidAppear etc that allows me to continue execution back inside my rootViewController where I can write the Entry.
What am I missing?
HALP!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要阅读 Apple 的导航控制器文档 和通过推送和弹出视图控制器来工作。当您将选取器视图控制器从堆栈中弹出时,您可以在根视图控制器中调用
-viewDidAppear:
来继续数据模型更新。You will want to read Apple's navigation controller documentation and work through pushing and popping view controllers. When you pop the picker view controller off the stack, you can then call
-viewDidAppear:
in the root view controller to proceed with data model updates.