Xcode Storyboard 是否应该支持带有“动态原型”的 UITableView 的 segues?细胞?
我无法让这个工作。如果我删除主 UITableView 以使用静态单元格,我可以让 segues 工作,这样当您单击主 UITableView 中的一行时,它会自动推动子控制器。但是对于“动态原型”单元,我单击其中一个单元却没有任何反应...
我是否应该以编程方式在 prepareForSegue
方法或其他方法中推送子控制器?在这种情况下,我不确定这里的 segue 相对于仅使用旧方法有什么优势
I can't get this working. If I drop the master UITableView to use Static cells I can get the segues working, such that when you click on a row in the master it automatically pushes the Child controller on. But with 'dynamic prototype' cells, I click on one of the cells and nothing happens...
Am I supposed to programmatically push the child controller within the prepareForSegue
method or something? In which case I'm not sure what advantage a segue here would have over the old way of just using
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不,您不必手动推动子控制器。您是否将情节提要文件中的segue从动态单元连接到子控制器?您还给动态单元格添加了标识符吗?您还可以查看本教程:
http://maniacdev.com/ios -5-sdk-tutorial-and-guide/xcode-4-storyboard/
向下滚动到“Beginning iOS Storyboards”并查看第 1 部分和第 2 部分。我发现它们最有帮助。
No, you don't have to manually push the child controller. Did you connect a segue in your storyboard file from the dynamic cell to the child controller? Also did you give your dynamic cells an identifier? You can also check out this tutorial:
http://maniacdev.com/ios-5-sdk-tutorial-and-guide/xcode-4-storyboard/
Scroll down to "Beginning iOS storyboards" and have a look at part 1 and part 2. I found them most helpful.
使用
prepareForSugue:
代替,[table indexPathForSelectedRowprepareForSugue
将在下一个场景的loadView
之前调用。Use
prepareForSugue:
instead,[table indexPathForSelectedRow prepareForSugue
will be called before the next scene'sloadView
.也许您忘记设置Table View Cell的重用标识符。
Maybe you forgot to set the reuse identifier of Table View Cell.