iphone - Using Custom View Controllers to manage different portions of the same view hierarchy -


the view controller programming guide states regarding view controller's usage:

each custom view controller object create responsible managing of views in single view hierarchy. in iphone applications, views in view hierarchy traditionally cover entire screen, in ipad applications may cover portion of screen. one-to-one correspondence between view controller , views in view hierarchy key design consideration. you should not use multiple custom view controllers manage different portions of same view hierarchy. similarly, should not use single custom view controller object manage multiple screens worth of content.

i understand if use multiple custom view controller's control parts of view (i.e. view controller manage subviews of main view in turn managed view controller) default methods like:

didreceivememorywarnings viewwillappear viewwilldisappear viewdidunload 

etc. etc. not called.

apart this, there other solid reason why should not using multiple view controllers manage respective subviews of view?

the documentation provide alternative solution reads as:

note: if want divide view hierarchy multiple subareas , manage each 1 separately, use generic controller objects (custom objects descending nsobject) instead of view controller objects manage each subarea. use single view controller object manage generic controller objects.

but there no mention why multiple view controllers should not preferred. question is:

why should not prefer way?

i concerned because prefer using uiviewcontroller's subclass manage views since load them nib each time , segregate nibs each view controllers. becomes easy cater changes in later stages of project. wrong? should change programming style, or ok if go ahead approach?

thanks,

raj

well, i'd "as long works", can keep on doing ! keep things "cleaner", i'd use own objects. since viewcontrollers designed other general features in mind (like working navigation controllers , tab bar controllers), makes bit "heavy" simple usage, do. plus, mentioned, events called when viewcontroller's view added main window.

can't use own objects interface builder ? if create 1 (or several) uiview iboutlet(s), should work same.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -