Wednesday, May 16, 2012

Best way to create dynamic list of links/buttons in iOS5 view controller

I want to create a dynamic set of links/buttons in an iOS5 view controller and am trying to figure out what might be the best way to do this.



For eg:



Item 1
Item 2
Item 3
:
:
Item N



Each of the Items is a link/button that is clickable and will do some action, like load another screen etc based on the link.



I don't know ahead of time how many items there might be so if all the items don't fit on the screen, I need to be able to scroll to view.



My question:
1. What is a better way of doing this? I could just create the labels and buttons dynamically but this seems rather cumbersome and I'm not entirely sure how I would differentiate between the different buttons (essentially I'd need some index to find out which Item was clicked).
2. Alternatively, I was wondering if I can just render this page as HTML and just have links? I've never done this and not sure how I'd associate a button with a link.



Any suggestions?



AK





No comments:

Post a Comment