I found some useful information on the web but I still can’t manage to do it by myself 😉
Ok, let me put my problem in context for you :
I have a first class (myViewController) whose declaration is below :
// i just give you relevant information
RssParser *rssParser;
UIActivityIndicator *activityIndicator;
In my viewDidLoad method (myViewController) I have :
//once again, I summarize it for you
[activityIndicator startAnimating];
[rssParser parse];
Now, suppose you are in the parserDidEndDocument method (which is in RssParser class), how am I suppose to stop the animation of the activityIndicator ? How can I get access to my instance of activity Indicator from the RssParser class ?
Hope I made myself clear 😉
Thanks guys!
Gauthier
A common way to do this is to use a delegate. Check the
RssParserclass for the use of a delegate or implement one yourself. Set the delegate ofrssParserto self inMyViewController. Now you can implement the method that is called after the document is parse withMyViewController. If you create an ivar foractivityIndicatorthen you can easily accessactivityIndicatoragain.