Recap of Tonight's Meeting / Next Week's Homework

0 views
Skip to first unread message

John Trupiano

unread,
Aug 27, 2009, 9:44:10 PM8/27/09
to BMore Hackers
We had another good session this evening. Some of us (Ed and Michael)
showed up with a reasonably complete assignment 3 submission. They
helped the rest of us work through ours.

I found the instructions to be a little misleading on Assignment 3,
interpreting them as suggesting we should hook the PolygonView
directly to the PolygonShape model (violation of MVC). I corrected
this by exposing a numberOfSidesForPolygon() function in my
Controller. However, I ended the session fighting some strange
reference errors that I currently suspect are related to circular
import statements (Controller.h imports PolygonView.h and vice
versa). I'm not positive about this, but it's what I currently think.

One notable about my implementation is that I added the PolygonView
through Interface Builder. Michael, on the other hand, added his
programatically.

Ed has updated his GitHub repo ( http://github.com/nerdEd/CS193P/tree/master
) with his completed assignment 3. Michael, are you pushing your code
up to GitHub?

It seems that two lectures per week is a good rate for us. So we'll
continue with lectures 6 and 7 and assignment 4 (labeled "Assignment-
Presence1.pdf" on the course site) for next Thursday.

-John

Tony Amoyal

unread,
Aug 27, 2009, 10:51:13 PM8/27/09
to bmore-...@googlegroups.com
John,

Thanks for the update.  Im in the midst of catching up to Ed and Michael and find the github repos a great way to compare implementations.

On that note, I was curious as to why you called retain in awakeFromNib in your controller implementation. 
http://github.com/jtrupiano/stanford_cs193p/blob/a0e0a22e710c746e699d0a36393c4a8e5103ed8d/HelloPoly/Controller.m
It is my understanding that since you called alloc, you get an object with a retain count of 1.

Tony
--
Tony C. Amoyal
www.tonyamoyal.com
www.dailysongfix.com
(240) 417-3112
corga...@gmail.com

John Trupiano

unread,
Aug 31, 2009, 9:15:58 PM8/31/09
to bmore-...@googlegroups.com
Hey guys,

I found the followup notes to lectures 4 and 5 ( http://www.stanford.edu/class/cs193p/downloads/0405-FollowUpNotes.pdf ) to be particularly helpful.

One thing it shed light on was my incorrect interpretation of MVC.  I incorrectly assumed that views shouldn't be able to reference models (which was a careless mistake on my part).  Views reference models all the time because that's where the data is stored.  The controller is simply responsible for making the models available to the view for reading.  A violation of MVC would be actually modifying a model.

On Thu, Aug 27, 2009 at 10:51 PM, Tony Amoyal <corga...@gmail.com> wrote:
On that note, I was curious as to why you called retain in awakeFromNib in your controller implementation. 
http://github.com/jtrupiano/stanford_cs193p/blob/a0e0a22e710c746e699d0a36393c4a8e5103ed8d/HelloPoly/Controller.m
It is my understanding that since you called alloc, you get an object with a retain count of 1.

You are correct.  According to the followup notes I linked to above, alloc automatically increases the retain count to 1.

Hope you all are making progress on lectures 6 and 7.

-John 
 
Reply all
Reply to author
Forward
0 new messages