PDA

View Full Version : [iOS]Very strange behaviour of SKCalloutView



high5fly
24.03.2016, 15:00
Hi,

If you have more then 1 annotation, for the purpose lets say you have 2. If u click on 1st(annotation) the calloutview will be shown, if you click on the 2nd(annotation) the calloutview will be shown, then will go back to the 1st for sec and then back to the 2nd annotation. It is very urgent to remove this bug/behaviour.

KR,
Milo

jimt2000
27.03.2016, 03:47
Some of us have seen similar behavior. Don't user an annotation id of 0 or 1. Use 10 or above. That may fix the problem.

high5fly
28.03.2016, 09:25
Hi,

I am using 10 as a start, still keep this behaviour... If needed I can post code.

KR,
Milo

high5fly
28.03.2016, 10:44
I have found me problem, basically it was bad setup from my side in the calloutviewForAnnotation. If you don't use custom view for callout just return nil and is ok :)


- (UIView*)mapView:(SKMapView *)mapView calloutViewForAnnotation:(SKAnnotation *)annotation {

self.skMapView.calloutView.dynamicArrowPositioning = YES;
[self.skMapView.calloutView.leftButton setImage:[UIImage imageNamed:@"map_button"] forState:UIControlStateNormal];
[self.skMapView.calloutView.rightButton setImage:[UIImage imageNamed:@"delete_button"] forState:UIControlStateNormal];
NSString *calloutTitle = self.dataA[@"title"];
NSArray *images = self.dataA[@"images"];
self.skMapView.calloutView.titleLabel.text = calloutTitle;
self.skMapView.calloutView.subtitleLabel.text = [NSString stringWithFormat:@"Number of images:%lu",images.count];

return nil;
}

Adela_Silvia
29.03.2016, 10:44
Testing the demo app, we've seen this behavior only on simulators and not testing on real devices. Sometimes, the simulators cannot be compared with real devices. Let us know if you've seen this behavior also on real devices.

high5fly
29.03.2016, 11:04
As I said in my previous comment, the problem came from bad setup and I don't experience this behaviour once I have set the method to return nil, neither on phone nor on simulator.

Adela_Silvia
29.03.2016, 13:43
Thank you for clarifying the situation.