Louis Feng | Out of Core

brain dump of things

  • Home
  • Blog
    • Tools
    • Algorithms
    • Design
    • Code
  • Projects
    • Shell Maps
    • Anisotropic Noise Samples
  • About
You are here: Home / Blog / Code / Programming iOS 4: Making Simple Ideas Complicated?

Programming iOS 4: Making Simple Ideas Complicated?

June 30, 2011 by Louis Feng 2 Comments

I have done a bit of iOS development lately. While trying to get myself familiarized with the new platform, I came across this book titled “Programming iOS 4″. I skimmed through some sections and found this paragraph:

You should not use a view controller in any other way. It is not, for example, appropriate to use a view controller to manage a view that occupies only a part of the window, or is a subview of anything except the window as a whole, except as a side effect of the fact that this is a contained view controller. This, I take it, is what Apple’s documentation means when it says:

You should not use multiple custom view controllers to manage different portions of the same view hierarchy. Similarly, you should not use a single custom view controller object to manage multiple screens worth of content…. If you want to divide a view hierarchy into multiple subareas and manage each one separately, use generic controller objects(custom objects descending from NSObject) instead of view controller objects to manage each subarea.

I had to read the first paragraph three times and still couldn’t be sure that I understood what it’s trying to say. It makes sense to suggest that one shall not use a view controller for a sub-element of a view (think of buttons and labels etc. which are technically subclasses of UIView). Not using a view controller for a subview of anything except the main window does not seem to align with the idea of UINavigationController or UITabBarController. The last “except” clause in the paragraph could be referring to these “side effects”, except it made the sentence more confusing (damn, except is infectious)! Anyway, I think the Apple documentation paragraph explained the idea more clearly without the use of double-except clauses. I’m thankful that the author put the documentation text in there for people like me.

I believe that often many concepts are in fact quite simple. It just takes great skill and knowledge to present them in a clear and concise way. I have no opinion on the book as a whole since I have not read it completely. Who knows, I may find it very useful.

Filed Under: Code, Mobile Tagged With: book, iOS, ipad, iphone, view controller
About Louis Feng

I have been a computer graphics enthusiast and researcher for many years. My interests has broadened to include mobile, high performance computing, machine learning, and computer vision.

Comments

  1. Victor says:
    July 13, 2011 at 4:17 am

    Did you find out what it means?
    I have the same problem and I dont know what to do. Did you find a solution?
    Thanks in advance.

    Reply
    • Louis Feng says:
      July 13, 2011 at 11:28 am

      Victor, what problem are you referring to?

      Reply

Leave a Reply to Louis Feng Cancel reply

*

*

CAPTCHA Image
Refresh Image

*

Archives

  • July 2015
  • April 2015
  • February 2012
  • July 2011
  • June 2011
  • April 2011
  • March 2011

Tags

book C++ clang cocoa container diff GDB git iOS ipad iphone iterator laptop list llvm map memory leak mobile nib software engineering stl Surface 3 Surface Pro 3 UITableViewController UIViewController vector vectorization view controller windows workstation

Return to top of page

Copyright © 2019 Louis Feng | Out of Core