开发者

UITableViewController Dynamic Drill-Downs

In a table-view that contains say 10 cells, is it the case that we need to create 10 separate UITableViewC开发者_如何学编程ontrollers to handle the different views loaded by clicking on each of those 10 cells?

That doesn't seem very efficient - especially in situations where large amounts of data (and thus tables/menu) need to be displayed.

How can you write a dynamic UITableViewController, that can accept any data-set (like an Array) on the fly and display its contents - and do it in a recyclable manner, so that it can be recreated again and again for each cell that is clicked?


I have it mostly working in an app I'm building - the only thing I don't fully understand about the method is how the incrementing of the "CurrentLevel" works since it seems like the variable would just keep getting reset since the controller calls itself.

Anyhow, the concept is that every time someone clicks a cell, a new instance of the UITableView controller is called and a new level is generated and added to "the stack", and a navigation controller is able to track what is in the stack and allow you to browse back to the previously loaded views.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜