ios - UIView Subclassing and OOP -


i have app model array of menu objects containing information such title, images, method etc.

i create scroll view list of menu views, maybe picture, title , short description each menu.

to this, subclass uiview , create menuview instance each menu.

my question how should communicate model view. far can see can either:

  1. alloc , init menu item , layout sub views (means view sees model)
  2. alloc , init title, image , description (means view doesn't see model doesn't seem offer advantage)
  3. use delegation view asks information data source (seems segregated complicated)

any advice?

it sounds tableview best choice. subclass uitableviewcell , add objects can take advantage of tableview behavior make life easier.

uitableview

a quick ios uitableview example


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -