ios - Dynamic number of UIViews in custom UIView -


i'm making custom uiview. holds bunch of uilabel objects subviews. count of uilabel objects unknown @ creation time. method in should initialize these uilabel objects? drawrect suitable job?

no, drawrect: not suitable. drawrect: drawing content of view, not modifying subviews of view. should update based on triggering event - perhaps viewdidload, viewwillappear:, or user event them pushing button. if triggering event on background thread need switch main thread before adding new labels subviews.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -