I am completely at a standstill, here is the situation:
My application uses the Core Location infrastructure to get the user's current location, and then ping my server on TrailBehind for interesting places nearby and display them as a list. No problems.
To save batteries, I will turn off the GPS service after receiving my data from the server. If the user moves while using the application and wants to get a new list, he clicks Refresh on the navigation controller, and the CLLocation service is activated again, a new batch of data is retrieved from the server, and the table is redrawn.
While the application is capturing data from my server, I load the download screen with a spinning globe that says “Download, please wait,” and I hide the navigation bar so that it doesn't hit “backward”.
So, the initial data capture from the server goes flawlessly.
The first time I hit the update, all codes are executed to get a new location, start the server again for a new data list and update the cells. However, instead of loading the table view as it should, it restores the navigation controller panel to present the table, but still shows my loading view in the main window. This is true only on the device, everything works fine in the simulator.
The SECOND time when I click update works fine.
THIRD time, when I click update, it fails as above.
The FOURTH time when I click update works fine.
FIFTH time when I click update, it fails as above.
etc. etc., even updates successfully, and odd updates fail. I stepped over all my code line by line, and everything seems to be working fine. I really continued to move on to the basic instructions, and after a huge number of “step by step” clicks, I found that the table view was actually displayed on the screen at some point in CFRunLoopRunSpecific, but then I clicked “continue” and my boot view took up the screen .
I am absolutely baffled. Please help !! Thanks so much in advance for your understanding.
Video of strange behavior:
Relevant Code:
RootViewControllerMethods (This is the base view for this TableView project)
- (void)viewDidLoad {
CLController Methods: basically just sends all the data directly to the RootViewController
// Called when the location is updated - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSLog(@"New Location: %@ \n", newLocation); NSLog(@"Old Location: %@ \n", oldLocation); @synchronized(self) { NSNumber *lat = [[[NSNumber alloc] init] autorelease]; NSNumber *lon = [[[NSNumber alloc] init] autorelease]; lat = [NSNumber numberWithFloat:newLocation.coordinate.latitude]; lon = [NSNumber numberWithFloat:newLocation.coordinate.longitude]; [self.delegate noteLat:lat]; [self.delegate noteLon:lon]; [self.delegate noteNewLocation:newLocation]; [self.delegate updateCells]; } }