I have a class that calls another class to parse (NSXMLParse) from a URL. Now I would like for the class calling this one to know when it has finished, so that I can populate the UI. I am guessing a delegate would be the way to go but ive never worked with one and would need some guidance as to how this would be wired.
Thanks
NSNotification is, in my opinion, the easiest way to setup something like this.
This is a small snippet from one of my apps:
in method.m when the something I'm processing has finished
[[NSNotificationCenter defaultCenter] postNotificationName:@"GlobalTagsReady" object:nil];
in the class to take care of the notification
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getTags) name:@"GlobalTagsReady" object:nil];
where @selector(getTags) is the method to be called
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With