I have a navigation controller with the toolbar enabled.I have a view controller with an MKMapView that is embedded in the navigation controller. When I run it in the simulator the toolbar shows up. However, when I try to add a UIBarButtonItem from code, the UIBarButtonItem doesn't show up on the toolbar. To add the button I have the following code in my viewDidAppear method:
var trackingButton:MKUserTrackingBarButtonItem = MKUserTrackingBarButtonItem(mapView: self.theMapView)
self.navigationController?.toolbarItems?.append(trackingButton)
//self.toolbarItems?.append(trackingButton) also doesn't work
Any Ideas on what is going wrong?