0
오랫동안 눌러 놓은 후에 그 위치 주변에서 오버레이를 꺼내려고합니다. 그러나 내가 긴 언론에서 설정 한 조치는 발사되지 않습니다. 여기 iOS 길게 누르기가지도상에서 작동하지 않습니다.
-(void) viewWillAppear:(BOOL)animated{
[super viewWillAppear:YES];
//add the long press options
//single finger long press
UILongPressGestureRecognizer *longPressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(getMapCoordinateFromTouch:)];
[longPressGesture setNumberOfTouchesRequired:1];
longPressGesture.delegate = self;
[self.mapview addGestureRecognizer:longPressGesture];
//double finger long press
UILongPressGestureRecognizer *doubleLongPressGesture = [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(removeBoundry:)];
[doubleLongPressGesture setNumberOfTouchesRequired:2];
doubleLongPressGesture.delegate = self;
[self.mapview addGestureRecognizer:doubleLongPressGesture];
및
는 쿨-(void)getMapCoordinateFromTouch:(UILongPressGestureRecognizer *) gesture{
if(gesture.state == UIGestureRecognizerStateBegan){
CGPoint touchlocation = [gesture locationInView:self.mapview];
pressedloc = [self.mapview convertPoint:touchlocation toCoordinateFromView:self.mapview];
[self createBundarywithRadius:.1];
}
1.보기에 중단 점을 넣으면 AppleAppear, self.mapView에 값이 있습니까? 2. 따라서 getMapCoordinateFromTouch의 중단 점이 실행되지 않습니다. – Dominic
그것은 nill입니다. 지도보기를 초기화하려면 어떻게해야합니까? – pudm