Re: Communication between classes
Re: Communication between classes
- Subject: Re: Communication between classes
- From: Jeremy Dronfield <email@hidden>
- Date: Fri, 28 Jun 2002 16:08:54 +0100
On Friday, June 28, 2002, at 08:14 am, Brent Gulanowski wrote:
>
Progress indicators I have not used yet. I don't see the connection
>
with buttons, unless the button initiates a process for which the
>
indicator provides status info.
The buttons increment and decrement the segmentCount int, which is
converted into a double for the benefit of the progress indicator,
putting the value through a method which calculates progress on the
basis of segmentCount as a percentage of totalSegments. I know the
methods involved work, because I built them in the prototype
single-window app. This is purely a problem of communication between the
model object (SRSettings) and the controller object (SRControls). As you
have seen from my code, I have no idea how to properly initialize these
files.
>
>
Theoretically, your button sends an action to a target object, which
>
itself then ought to keep the progress indicator updated. But the
>
target object is also meant to be taking care of the process -- it
>
can't do both things at the same time. You have to stop the process
>
momentarily, update the progress bar, continue the process etc. This
>
all assumes your target has the progress bar as an outlet so that it
>
can actually send it messages.
>
Are display and display2 your textViews? I'll assume so. I strongly
>
recommend that the sRSettings instance update the progress bar itself,
>
if possible. Actually its not obvious that SRControls and SRSettings
>
are not in fact two halves of the same Platonic class (as in the
>
Platonic ideals).
>
>
This is exactly how it was set up in the prototype - I changed it all in
order to conform to the holy paradigm of MVC.
>
>
So, basically, the most glaring problem that I can see is that your
>
window controller has a bunch of IBOutlets which could not possibly be
>
connected to anything if, as is apparent, it is created
>
programmatically.
It is created in IB, in MainMenu.nib, not programmatically. The fact
that my code leads you to think otherwise shows the size of the problems
I'm having with my initialization, I suppose.
I've since decided that I don't know enough yet about initialization to
go for MVC in a big way, and have decided to go back to my one-window
prototype and gradually farm out functionality, adding other objects one
at a time.
Thanks very much for taking the time. There comes a point when misakes
are so dumb, even the most knowledgeable can't work out what the hell is
going on. Still, I've only had four weeks with Cocoa, and inexperience
can excuse a multitude of sins.
- Jeremy.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.