My Setup:
In my iPhone app, I have a loading View (which is an UIImageView itself) and two subviews on the loading View, an UIIndicatorView and an UILabel. To view it, I call the [self.view addSubview:loadingView]
method, and to hide it i use [loadingView removeFromSuperView]
.
In my app to refresh my data i have the method -(void)refreshData
. in this method, I show the Subview, download some data resulting from an HTTP POST, and start and NSXMLParser with this data.
when the NSXMLParser reaches the last element of it's -(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
method, it then hide the subview (using the above method).
To call the refreshData
method i have a refresh button in my Navigation Bar:
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refreshData)];
My Issue:
When I click the refresh button the subview does not show. It calls the methods because in the Log I clearly see:
Showing Loading View
Bunch of lines shown during the loading process (totalling 15 seconds)
Hiding Loading View
I also know that my methods work because when I comment out the one that hides the view the Loading View continues to be seen until I close the app
can anyone help? (just ask if you need any more code)