Well, when you first said that parseXMLFileAtUrl was a class method, I sort of assumed you had some reason for that in your design.
But I think maybe there wasn't a reason for that. Now that I've seen the implementation, it don't understand why you made that a class method at all. It looks to me like that should have been an instance method. But then again, I don't know your design. I only know what you've told us so far.
I can tell you this much: to parse XML with NSXMLParser, you have to create an instance (an object) of type NSXMLParser. And then you need to give that NSXMLParser object another object to use as its delegate.
So you can't give the NSXMLParser your MeetingXMLParser class. You have to give it an instance of that class. In other words, you have to give it a MeetingXMLParser object.
So you can do it like this:
1.) Create an instance of MeetingXMLParser (alloc/init)
2.) Call the instance method parseXMLFileAtUrl on that new instance.
3.) That instance method will create an NSXMLParser (your code does this already, except I don't know why you used NSClassFromString?)
4.) that instance method should set the delegate of the new NSXMLParser object to be your instance of MeetingXMLParser. (again your code sort of does this, but what you did doesn't make sense in a class method)
5.) Your instance of MeetingXMLParser will get all the delegate callbacks that NSXMLParser needs to parse the document.
I hope that makes sense?
|