problems intergrating NSURLConnection with UITableView
Hi, I'm developing an app that requires the use of NSURLConnection, which sends a request to a remote webservice, and gets xml data back.
I store the xml data into a NSData instance, and parse and transfer the data into an array of my own custom class objects. This array is managed by a UITableVIewController (which follows the tableViewDelegate and tableViewDataSource protocols), and then displayed to the UI. At the UI I have a root navigation controller, that pushes my tableViewController. All sending and fetching of xml data occurs in a method, which I call under ::viewDidAppear of my tableViewController.
I have gotten the data to appear in the table cells, but however, I cannot select my cells, nor can I press the back button on the navigation bar. (and i tried to enable selection also, but that's not it).
However, when I did not call the NSURLconnection, and initialized the data source instead with local objects, everything goes fine, and I can select my table cells and nav bar back button.
So I'm wondering, does this problem have to do with when NSURLConnection finishes? Is it a threading problem or even a view hierarchy issue? or could it be the simulator itself?
BTW: I have a login screen which is presented as a modal view over my root navigation controller. After login, the login screen is dismissed, and the navigation controller pushes right to the UITableView. Could it also be the difference between when UItableViewController's loadView and viewDidAppear are called?
I am very puzzled at this issue. If anybody could help me or offer any advice on where to start fixing this, it would be greatly appreciated.
Thanks in advance!
|