MVC and the communication between them. What did i miss?
Hey all, trying to learn objective-c. It was going quite well, until I realized I was missing a link.

When building in the spirit of MVC, I understand it as you Model and View should never talk to eachother.

I have this problem I'm messing around with now.

 - A model containing a polygon class.
   Contains an polygon object with
   attributes like numberOfSides.
   
 - A controller, reading some UI
   elements and modifying the model. For
   example numberOfSides.
   
 - A view, containing a view drawing
   polygons.


Now, this is where the trouble arose. The view needs information about the object from the model. How do I get that? I tried some IBOutlet, but never got it to work.

I ended up creating a property for the view which could contain numberOfSides. Then I would a controller method which would call a view method back and set the numberOfSides.


I hope some of you can clarify this a bit for me and tell me how you should go ahead with this.


Thanks a bunch and goodnight! :)
MVC and the communication between them. What did i miss?
===

Hey all, trying to learn objective-c. It was going quite well, until I realized I was missing a link.

When building in the spirit of MVC, I understand it as you Model and View should never talk to eachother.

I have this problem I'm messing around with now.

 - A model containing a polygon class.
   Contains an polygon object with
   attributes like numberOfSides.
   
 - A controller, reading some UI
   elements and modifying the model. For
   example numberOfSides.
   
 - A view, containing a view drawing
   polygons.


Now, this is where the trouble arose. The view needs information about the object from the model. How do I get that? I tried some IBOutlet, but never got it to work.

I ended up creating a property for the view which could contain numberOfSides. Then I would a controller method which would call a view method back and set the numberOfSides.


I hope some of you can clarify this a bit for me and tell me how you should go ahead with this.


Thanks a bunch and goodnight! :)