After the map zooms and I annotate the location, the map disappears and all I see is a blue background with a red pin for the location. If I click on the red pin, I see the annotation but the map is gone. Any idea what the problem might be?
I just ran into that same problem myself. I’ll let you know if I find anything
I have the same problem. The map disappears after I add the annotation.
Could someone please help?
[color=#0040BF]The map hasn’t disappeared; it is there. If you zoom out far enough, you will see the map. Somehow the application thinks your current location is somewhere in the Pacific or Atlantic Ocean. On my application, I have a red pin drop in the Atlantic Ocean a few hundred miles east of Novia Scotia. I’m not sure why this is the case. I’m still working on my application to determine the root cause of this problem.[/color]
Here’s some helpful information for those still having trouble:
[quote=“JonSanders”]djhoward, if you used the location hack that Joe wrote for those of us using the simulator (see http://forums.bignerdranch.com/viewtopic.php?f=79&t=2069) then the app worked by displaying Apple HQ.
The simulator is running on a laptop or desktop and those do not have the same GPS hardware and location services for cell towers as the iPhone (see Page 80 where the book is discussing the distanceFilter property). Thus, he had to “hardcode” coordinate values into the app to force it to see a location and thus allow the app to work when running on the simulator.
If you ran the app from the beginning on an iOS device (iPhone/iPad) then I don’t think you needed the extra code. It is helpful to note that the authors did put a note in the Introduction that stating getting fully credentialed by Apple was best because you test the app on a device. I’m only on Chapter 5 and I’ve run into two problems not being able to use my device (taking a screenshot and the location hack). I’m thinking it is time to start the ball rolling on a full Dev license![/quote]
I’m having the same problem with running the app in the simulator, running xCode 4.2, Build 4D199. Using both editions of the book and several previous versions of xCode and IOS, I have never seen this app run correctly in the simulator. I think this is an overly complicated application for use in teaching persons new to IOS at the point in the book in which it appears. In my opinion, the app unnecessarily frustrates the new initiate and inhibits the continuation of progress in finishing the book.
Yes, this hack was just to fix a short term bug. I picked some random numbers for the latitude and longitude, which apparently puts you in the middle of the Atlantic ocean (hence the blue background).
If you see a pin and a blue background, you’re good.
I think my pin was on a white background. What would that mean?
Perhaps you are in a desert. Or the tiles haven’t loaded yet… but if oyu see a pin, you are okay.
After the xocode is upgraded to 4.2.1 and the Iphone 5.0 simulator is used, the map shows up fine after adding the annotation.
Before the upgrade, I had the problem with the map showing the annotation.
If you use the ‘freeway drive’ in the 5.0 simulator, many annotations can be added to the map without problems.