views:

18

answers:

0

Hi All I am developing an application that has a tabBar. On tapping a tabBarItem a new connection object gets created with some URL. Now the problem is that as much items we select on tabBar, that much number of connection objects gets created and all runs simultaniously. I want to close the previous connection on selecting a new tabBar item (so that only one connection object is present at a time).

Is it possible to do this??

Right now what I am doing is when a tabBar item is selected the connection objects gets created with the respective URL and parsing of XML from the server starts.To ensure the existence of only a single connection object at a time what I do is until and unless parsing is over I disable all the tabs of the tab bar.
This is what I don't want to do at all.