I have three different classes, one of them is parsing xml from a certain website and the two other will be recieving the information from the class that is running the NSXMLParserDelegate protocol methods. My question is, how do i tell the class to run the protocol methods from another class? Or run every instance method or the whole class or something like that.
Any suggestions?
Edit: I'm going to parse xml information from a website when some certain view is active. To do this, i'm going to have a class that i'm going to send a message to, and tell it to run its methods from the xml parser protocol and send the value it recieves to the view that is present.
There are two ways of seeing it.
An object (A) having a pointer to the delegate (B) (the delegate is the object that implements the methods of a protocol) can call the methods of the protocol by just invoking them. Form the delegate's (B) point of view, you don't call the protocol's methods, you IMPLEMENT them, and some other object (A) will call them whenever it needs to inform you of some event, or to request some information. That's what protocols are designed for.
Object (A) somewhere it declares the delegate
and whenever it want's, it calls the protocol's methods
(B) must declare itself as an implementor of the protocol
then (B) sets itself as the delegate of an instance of (A)
and finally (B) implements the protocol's methods