iphone - Create a View Controller and access labels in iOS -


i have several xibs in have same status bar. status bar composed of view object , in several labels.

in spirit of dry, i'd create uiviewcontroller take care of populating status bar, , not repeat in each view controller.

from limited ios dev knowledge, best path create subclass (maybe called statusbarviewcontroller) inherits uiviewcontroller, , in interface builder indicate view of class statusbarviewcontroller.

in statusbarviewcontroller code, override viewdidload populate labels.

my question is, how list of labels within view controller code? better create labels code or ib? (which copy/pasting 1 xib rest).

am missing approach? there better way?

thanks!

what can try in case :

  • create viewcontroller status bar , empty view below covering rest of area use placeholder view other view controllers (say view a)
  • now show viewcontroller add controller on subview like

     [a addsubview:anotherviewcontroller.view]; 

    and remove

     [anotherviewcontroller.view removefromsuperview]; 
  • in case status bar handling code @ same place in first viewcontroller.

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -