Re: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging
Re: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging
- Subject: Re: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging
- From: Jason Wiggins <email@hidden>
- Date: Sat, 21 Jun 2008 14:56:28 +1000
Thanks Henry for your response. I'll have to read that a couple times
to let it sink into my thick skull. Not sure why the DL link is zero
length. Here is a better link: http://members.optusnet.com.au/jwiggins/xcode/TestCase.zip
The reason I connected things in the way I did was to understand what
was and wasn't happening. But then again, as stated, I'm doing
something fundamentally wrong.
Regards,
Jason
On 21/06/2008, at 2:35 PM, Henry McGilton (Starbase) wrote:
On Jun 20, 2008, at 5:48 AM, Jason Wiggins wrote:
Hi everyone,
If possible, could someone please educate me on the fundamental
mistake in my understanding of use of classes/instances/
encapsulation/messaging. I have reread the Object-Oriented
Programming with Objective-C but didn't find my answer.
I have written a test program with three classes- Model, View and
Controller and a Window with a button and a popup button. There are
setters and getters to test getting data in/out of the Model Class,
which works as expected.
Okay, so you have a model, and you have a Controller, and you have a
View.
Where is this View ? Is it a sub-view of the window's content
view ?
Both the Controller and View Classes are connected to the popup
button in IB.
Connected in what way ? Do you have a connection *from* the
Controller and
*from* the View to the popup button ? If so, why ? What do you
expect to
happen ? And what is the other button expected to do ?
Sounds like the connections are going in the wrong direction.
Let's ask the fundamental question: when the popup button changes
state, what do
you want to happen inside the program ?
If I were doing something like this, I would expect that the popup
button
changing state would send an action message to the controller to
tell the controller
there's been a change.
The controller would then tell the model to update its state, and
finally, the
controller would send the new state to the view and possibly tell
the view to
re-display itself.
What I want to do is have the View Class to return the value of the
selected index of the popup button, but all I ever get is 0. I get
the value OK from the Controller Class though. I am obviously doing
something fundamentally wrong or misunderstanding "something".
Here is the program:
ftp://email@hidden:21/xcode/TestCase.zip
That .zip file is a zero-length file . . .
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden