Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Early:</p> <blockquote> <p>In order to learn from scratch (and because I know my app would need dynamic views), I decided not to use Interface Builder.</p> </blockquote> <p>Later:</p> <blockquote> <p>As soon as I try to create something on my own which is not a "Hello World" screen, I realize that something is missing, logic wise.</p> </blockquote> <p>I think what is missing logic wise is that you have accepted your assumption that Interface Builder was a crutch and that to learn "from scratch" you had to avoid using it. You are trying to learn the MVC design pattern but you are not willing to use the tools that have been designed to support it.</p> <p>In <a href="http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/CocoaDesignPatterns.html#//apple_ref/doc/uid/TP40002974-CH6-SW1" rel="nofollow">Apple's own documentation</a> they discuss the fact that sometimes there is value in having combined roles—Model Controllers and View Controllers—and that is worth reading, as it may explain some of the code examples you're reviewing. But my primary advice would be: before assuming you know better than the people who built the tools, trying using them the way they recommend. It might be an eye-opener.</p> <p>Additions later: OK, so to try and actually answer your questions...</p> <blockquote> <p>1)Where should I put the the second view (along with the first one in "xxxView" or should I create another class h and m file?)?</p> </blockquote> <p>If I am understanding correctly and the two views you are thinking of here are the red and the blue displays to the user, you wouldn't have a second view—what you would do, whether in IB or in code—is to have an element in your view on which you changed a colour property... This would be done programmatically whether you were setting up the parent view in IB or in code. </p> <blockquote> <p>2) What would the controller(s) do, for that kind of application? In which files would they be created and in which files would they be invoked and how would they "control" the related view?</p> </blockquote> <p>There would be a view controller that would implement the gesture support, and would provide a method for changing the colour of the item in the view between blue and red when that swipe gesture was successfully received. I would have a ViewController.h and and ViewController.m. I think if you were implementing the View entirely in code, it would be implemented in the ViewController.m rather than having a separate View.m. (If you were using IB, you would have a ViewController.h, ViewController.m and ViewController.xib, with the latter providing the basic setup of the view elements and layers.)</p> <p>You would create a ViewController instance in your AppDelegate.</p> <blockquote> <p>3) Mainly, regarding to MVC pattern and the fact that there would be no IB, how would you organize that app?</p> </blockquote> <p>As above.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload