ios - Why MKMapView is not showing current location red pin? -


mapview showing current location no red pin (or blue circle) appears. location services enabled on device. however, red pin shown running on simulator same code. set required property:

self.mapview.showsuserlocation = yes; 

i'm using custom pins, however, "mapview:viewforannotation:" called each custom annotation, looks method not called current location , that's why it's not showing red pin. however, strange why same code runs correctly on simulator.

update created empty single view project mapview. did add self.mapview.showsuserlocation = yes no current location shown on device. blue circle shown in simulator. i'm using ios 6.1.2 on iphone4.

mapview:viewforannotation: called current location.

from docs:

if object in annotation parameter instance of mkuserlocation class, can provide custom view denote user’s location. display user’s location using default system view, return nil. 

in implementation of delegate method, check class of annotation passed in , proceed accordingly (either return nil use blue dot or return custom view).

if it's not getting called, else afoot.


Comments