I study the material for iOS development, and what I found in textbooks and books is that at the controller level, there is usually access to View controls directly (text fields, labels, etc.). Consider this example:
Suppose the View has a label called lblResult and a text field called txtDataToAnalyze . In the management interface, we have something like this:
@property (nonatomic, retain) IBOutlet UILabel* lblResult; @property (nonatomic, retain) IBOutlet UITextField* txtDataToAnalyze;
and some @synthesize in the implementation file.
I have some JavaSwing development experience where most of them think that I write manually without any graphical constructors, and what I usually do in MVC is access to View controls via getters / setter. For example: void setResult(String resString); or String getDataToAnalyze(); . Thus, the controller only knows which pieces of information are displayed in the view, and not how they are displayed. I think it is more flexible (it is easier to change the view layer later).
I know that iOS has some specific rules, introduced XIB / NIB files, etc., so maybe my doubts are completely useless in the case of the development of iPhone / iPad. But I'm going to write another serious iOS app (actually โrewriteโ it from Java Swing), and so I would like to ask you:
What do you think, I should change what I think and get used to this new (for me) approach (xib files, creating a graphical interface using drag & drop and providing the controller with information on how the data should be displayed in the field of view ) ?? Have you had similar doubts when starting with iOS?
source share