In an iphone application that I am building, I am parsing XML in a number of view controllers when they are loaded by a user.
Every time I do this, I am doing the following:
- establishing an NSURLConnection (in viewDidLoad)
- storing the data retrieved and error handling (connection delegate methods)
- creating an NSXMLParser
- parsing the XML (NSXMLParser delegate methods)
I'm curious to know what your approach to this problem would be?
I myself intend writing a simple subclass of id with a few object methods and all the NSURLConnection and NSXMLParser delegate methods contained in it -- so that responsibility is with this subclass and can simply be instantiated in a viewcontroller. Is this viable, or should the delegate be my view controller?
Thank you