如何将一个单元格从一个数组推送到另一个控制器数组?
我正在开发一个导航应用程序,并遵循“开始 iPhone 4 开发”中的第 9 章。我希望我的应用程序是这样的:
a
rootViewController
在viewDidLoad
部分包含一个控制器数组(就像书中介绍的那样);当用户点击controllers数组中的任意行后,应用程序将转到相应的屏幕,该屏幕也包含控制器数组;
那么数组中的每一行都会在点击后生成一张图片;
就是这样。我已经完成了 rootViewController.m
中 viewDidLoad
控制器数组中 rootViewController
和其他控制器的编码,但它不会进入下一个控制器阵列。
如果有人知道如何解决这个问题,请帮助我。谢谢~~
I'm developing a navigation app and also following the chapter 9 in "Beginning iPhone 4 Development". I want my application to be like this:
a
rootViewController
contains an array of controllers inviewDidLoad
part (like the book introduced);after users click on any row of the controllers array, the app will turn to the corresponding screen which also contains an array of controllers;
then each row in the array will lead to an image after a click;
That's it. I have completed the coding for rootViewController
and other controllers in the viewDidLoad
controller array in rootViewController.m
, but it just won't go the next controller array.
If anyone knows how to solve this problem, please kindly help me. Thank You ~~
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您似乎忘记实现 tableView Delegate 方法。您需要实现 didSelectRowAtIndexPath 方法;当您点击单元格时,将调用此方法。然后在该方法中,您需要通过这行代码获取已预先填充到数组中的 UIImage 对象,
然后分配 imageViewController 并将图像对象传递给 imageViewController,然后将控制器压入堆栈。如果不发布代码,希望您能理解。
It seems you forget to implement tableView Delegate methods. You need to implement didSelectRowAtIndexPath method; when you tap on a cell this method will be called. Then in the method you need to get UIImage Object which you have prefilled in an array through this line of code
Then allocate your imageViewController and pass the image object to the imageViewController and then push the controller on stack. Hope you understand if not post the code.