0

I have a map loading up on my iPhone which shows pin annotations. I set these up by having objects which conform to the MKAnnotation protocol.

Now, the annotations show up on the simulator but, rather bizarrely, not on the device. FYI, I've got network connectivity on both and the device is running iOS 3.1.3.

Any suggestions?

EDIT

Objects are instances of a class like this:

@interface Point : NSObject <MKAnnotation> {
// etc...

then these are added to the Map View Controller like this:

MyMapViewController *m = [[MyMapViewController alloc] initWithNibName:@"myMap" bundle:nil];
// Set up Point, thisPoint, with location info...
m.point = thisPoint; 

Note, my viewForAnnotation method is not being called on the device. It IS being called on the simulator (i.e. the pin is shown on the simulator).

Snowcrash
  • 80,579
  • 89
  • 266
  • 376
  • Show how the annotations are added to the map and the viewForAnnotation method. –  Apr 28 '11 at 16:05
  • 1
    That's not enough code to see any possible issue. Check if any iOS 4.x methods are used. Try debugging it live on the device to see if the addAnnotation call actually succeeds. –  Apr 28 '11 at 16:46
  • I had forgotten the addAnnotation call. Odd how it worked on the simulator but not on the device! If you want to copy and paste your comment into an answer I'll tick it off. Thanks. – Snowcrash Apr 28 '11 at 17:04

1 Answers1

0

I had forgotten the addAnnotation call. Odd how it worked on the simulator but not on the device!

Perhaps the simulator was running a different build or you had different code running based on version.