views:

101

answers:

1

This is hard to explain so bear with me ... I'm using an example that I know works. It's the MapMe chapter from the Apress More iPhone dev book.

I'm using the same code but I've created a MapViewController class to contain all the map code and am inserting the view from the nib as a subview of my MainViewController view. With me?

My problem seems to be this : now the view containing the MKMapView object is a subview of the MainViewController it doesn't want to add the annotation object into the view. I can change the mapType and can initiate the locationManager:didUpdateToLocation to pinpoint my location. Indeed it drops the default red pin for me. My custom annotation object is not passed though.

Remember, this code worked fine when run directly from the MapViewController. It only breaks when I insert the view as a subview of another ViewController.

A: 

Ok, I'm an idiot ... the delegate wasn't set in the NIB ... DOH!!! Schoolboy error. Lesson learned.

Lee Probert
Not a bad thing to track problems on this site ... even if you do solve them yourself. Might help someone else in the future.
Lee Probert
Accept your answer as correct so everyone will be able to see that (and how) your problem is solved
Vladimir