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

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -