In article
<e14ec9de-2626-4667-a2ba-0ced52509f44@e23g2000prf.googlegroups.com>,
> I have a class with a set of 5 variables that are continuously
> updated. I have another class with the same variables that needs to be
[quoted text clipped - 12 lines]
>
> Would a delegate method be the correct way to implement this?
A delegate is one way to do this. You might also consider using
NSNotification, or key-value observing via
-observeValueForKeyPath:ofObject:change:context:
> and if so how would I pass it the values? Both examples I mentioned
> use a generic NSObject interface like this:
[quoted text clipped - 7 lines]
> is this necessary? and what does it do exactly? Thanks for any advice
> in advanced!!!
That's an informal protocol, so called because objects can choose to
implement the method(s) or not as appropriate. When you want to call
one of the delegate methods, you first need to check whether the
delegate actually implements it. The purpose of a declaration like the
one above is to make clear what method signatures you're using and to
keep the compiler happy.
You can also declare a formal protocol (with @protocol), where objects
that adopt the protocol must implement all of the declared methods.
Which is appropriate depends on the situation-- i.e. whether it makes
sense for the delegate objects really need to implement all delegate
methods, or if they only need to implement some of them to be useful.
As for how you pass the values, your delegate methods can take as many
arguments as you need them to take.

Signature
Tom "Tom" Harrington
Independent Mac OS X developer since 2002
http://www.atomicbird.com/
echosummet@gmail.com - 21 Mar 2008 23:02 GMT
On Mar 19, 4:54 pm, Tom Harrington <t...@pcisys.no.spam.dammit.net>
wrote:
> In article
> <e14ec9de-2626-4667-a2ba-0ced52509...@e23g2000prf.googlegroups.com>,
[quoted text clipped - 53 lines]
> Tom "Tom" Harrington
> Independent Mac OS X developer since 2002http://www.atomicbird.com/
Thanks Tom,
I am running with NSNotification and it seems to be doing exactly
whats needed. Thanks again.