views:

217

answers:

0

Hello,

I'm using the XMLRPC framework (by Eric Czarny) for iPhone to communicate with my server. I am using the XMLRPCConnection class (which is basically an extension of NSURLConnection) to create asynchrnous HTTP requests to fetch my data. The connectionDidFinishLoading method sends one and the same NSNotification each time data has been loaded.

I have 2 views (in tabs) that are using methods of a singleton class to request data from the server (this is done in the respective view controller of course). It's the same data, just that for one view I need a subset and for the other one I need the complete dataset, but then I handle the data in a different way.

The problem I have is that both views react when the notification is received and then things of course blow up. I can retreive the XMLRPCConnection delegate and the RPC method called and send this information in the notification user message, but if I am using the same class and same method in two different view controllers I do not know who requested the data initially.

One thing I could do is replicate the methods in both view controllers and set them as delegates. What's your thoughts on this? What about a central (possibly singleton) object that would work as a notification distributor?