Tracking AppInfo
Code
Model The property methods in are shared, so write them in the . h file.
data manipulation in Model completed in .
when the program runs, first execute the Viewcontroller, it will work on its own member initialization! After the preparation is finished, the load operation of the view that it manages is started , and it goes to the viewdidload method .
when carried out here due to its members to itself Nsarray *applist was carried out Setter Override, so the rewrite is called after the Setter Method .
in the setter method -(Nsarray *) applist , it is judged if _applist is empty, the [Appinfomodel appinfolist] is called to assign the value. To get the model array for the Appinfomodel .
This went to the class Appinfomodel . (Model layer )
appinfolist is to return a mutable array, changing the contents of the array to its own model, which includes the name and Icon two properties.
When the program executes this step, the Controller has extracted the data from the local plist and is saved in a name called appinfomodel array of c3>.
and then back to the controller 's Viewdidload method,
The program executes appinfoview *appview = [Appinfoview appinfoviewwithappinfo:self.applist[i]]; (view layer)
This sentence passed in a parameter self.applist[i], This parameter is the model, which is stored in the applist array, by subscript Determines that this is a model that exists in the plist . and the method Appinfoviewwithappinfo: very simple, the function is to create a view, this view contains not only the view (a label, an image, a button), and also contains the appinfo information from the incoming model , And saved in this view 's member properties Iconimage and Namelabel .
To perform this step, the data and viewthat are stored locally in the plist file are loaded and then the 9 App VI EW is arranged and added to the view managed by the controller .
Next is when the user clicks the download button, the home screen will display a label prompt is being downloaded and disappears after a few seconds, this is B ( the view that Controller manages) To listen for a (Appview), when a is clicked, B to add that label to display for a few seconds before disappearing.
so use the proxy mode, B for a the agent, when a was clicked, notice b you have been clicked, what needs to be done.
Controller in
Appinfoview in
Controller the.
Well, that's the general process of this program.
Tracking AppInfo Code