Im working my way thru Lecture 9. Recapping what ive done, i created 2 Preence2 projects; first i pass data using the custom initWithpassedData: method which didnt let me use the initWithStyle for the tweets table view, and second I used the appDelegate pattern which i dont like cause its really a global variable.
So Im looking into KVOs and NSNotifications but they look kinda scary!
I started using plists for a couple of projects, found out they can be further structured to no just a simple array or a dictionary with keys and objects, but also kind of a flat db with parents and childs. Ill try using plists and later migrate to SQLite which is easier given my programing background. I also started writing to disk so i hope i can add that functionality to my projects so i can write those plists or db files on the iphone. Otherwise ill have to use an online account-structured storage to have my users log in online on a comfortable desktop interface and have the iphone get the data from the web and write it to the iphone for certain apps where i want end-user modifiable code.
Picked up cell.detailText.text and started on CoreLocation because I’m learning from Stanford and iPhone Auditors Google Dev Group as well as research on web.
I’m using this blog as an unorganized way of recording progress so it may be sketchy.
I have been struggling for days with this concept which only became apparent in Presence 2, not so in HelloPoly. Ive read the ObjC literature and read about creating class files for data you are customizing or creating. For some reason i thought creating a Class File like Person Object Class or Polygon Object Class meant that i created a ‘container for my data’ and then filled it up. This implied that the Person Class would serve as a DataStore for my persons.
From what i now understand, from looking at the SimpleDrillDown.app from Apple is that its actually just a ‘mold’ for data, not really a store. I kinda see it like one of those cookie cutter shape molds or a pasta maker thingamajigger where you FORCE your cookie dough, pasta mix or data into the shape or structure you want. But then, and this is the important part, you remove the mold and store the actual data somewhere else. In SimplDrillDown.app they create a Play Class which tells the program that the object Play is to be stored with title, genre, date and even characters. Then a DataController class file, is where the data in this case is hardcoded by saying instantiante a Play, set title, genre, date, and characters (which is actually an array or people) and this is one object instance, put it into an array, and then release the Play mold so that someone else can use it.
So this means when you want to get your data, you actually get at your array, not at your Play object directly. For some reason i thought you had to call Play.RomeoandJuliet or Play.JuliusCaesar or Play where title = Othello in order to get the information out. So i was complicating myself trying to write code that i assume doesnt exist and on top of it all thinking the use of an array to put the data into was redundant or inefficient.
In HelloPoly we create the Polygon Class Object which is the mold for the data we want to store, which is really just numberOfSides. We created a Controller Object in the nib which i understand connects the polygonview to the polygonshape object; would this be equivalent to a TableViewController for a TableView and a plist file in twitter Presence2 app?
And we create 1 polygonshape instance at init and then just update the same instance with new numberOfSides, we dont create new ones.
The model is in fact an object like an array.
And it is a very clear cut division between model and view.