Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging
Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging
- Subject: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging
- From: Jason Wiggins <email@hidden>
- Date: Fri, 20 Jun 2008 22:48:40 +1000
- Resent-date: Sat, 21 Jun 2008 13:35:06 +1000
- Resent-from: Jason Wiggins <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: Cocoa Dev <email@hidden>
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. Both the Controller and View Classes are
connected to the popup button in IB. 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
The console output I get is as such:
[Session started at 2008-06-20 22:39:25 +1000.]
2008-06-20 22:39:25.780 TestCase[1439:10b] AwakeFromNib called
2008-06-20 22:39:25.784 TestCase[1439:10b] AwakeFromNib called
2008-06-20 22:39:25.784 TestCase[1439:10b] AwakeFromNib dataString is:
Initial Value
// Select the second item from the popup button and press the button
2008-06-20 22:40:12.004 TestCase[1439:10b] dataString is: Initial Value
2008-06-20 22:40:12.005 TestCase[1439:10b] dataString is:
2008-06-20 22:40:12.006 TestCase[1439:10b] dataString is: TESTING...
2008-06-20 22:40:12.007 TestCase[1439:10b] popUpButtonSelectedIndex
called and index of selected item is 0
2008-06-20 22:40:12.007 TestCase[1439:10b] View selected index is: 0
2008-06-20 22:40:12.008 TestCase[1439:10b] Controller selected index
is: 1
Any help would be greatly appreciated.
Jason
_______________________________________________
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