Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cklongshot

macrumors newbie
Original poster
May 15, 2010
5
0
I am building a store locator app but can not find any help on the proper order of how the code should be structured with my navigation controller stacking.

What I have so far:
ViewControllerOne - With a button that says "use current location". When pushed goes to ViewControllerTwo
ViewControllerTwo - Runs my LocationManager and gets users current location. Once it has the current lat & long it stacks the Third View passing the lat & long strings.
ViewControllerThree - Picks up the lat & long strings and then appends it to a NSURL domain.com/file.xml?lat=232.2323&long=-1232.23 During this part I run my NSXML commands to parse and retrieve the data and display in my Table.

This all seems to work just fine in the simulator but on my device what happens is the data does not display in the table. I confirmed it does gather all the data but it does not seem to show unless i click a different tab and then go back to my locator tab. It will then show the results but remaining on the same tab going through the above process does not work on my device but works correctly in the simulator.

My Questions:

Has anyone else seen this behavior before?
Is my logic in stacking my views okay or should this be done differently to get the users location and then parse xml and display stores?
One issue i also see with my flow is I don't want the back button in the navigation controller to reload my ViewControllerTwo. How would I get this to function so that when I am on ViewControllerThree looking at listings and hit Back it would go to ViewControllerOne?

The problem is that there is no resource I can find that discusses how the structure of code should be and how ViewController should be stacked. I think at this point my biggest problem is trying to fix why it is not working on the device but works great in the simulator. Otherwise everything would work just fine. I gathered my logical structure from seeing how other apps handle this and the process from what I can tell is the same flow.

Any help would be great. I have been trying to fix this for weeks now.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.