0

我正在尝试使用以下代码比较两组RMAnnotations(MapBox SDK for iOS 中使用的注释):

 NSMutableSet *before = [NSMutableSet setWithArray:self.mapboxView.annotations];

if(self.mapboxView.userLocation)
    [before removeObject:[self.mapboxView userLocation]];

NSSet *after = [NSSet setWithArray:annotations];

NSMutableSet *toKeep = [NSMutableSet setWithSet:before];
[toKeep intersectSet:after];
NSLog(@"to keep %lu", (unsigned long)toKeep.count);

NSMutableSet *toAdd = [NSMutableSet setWithSet:after];
[toAdd minusSet:toKeep];
NSLog(@"to add %lu", toAdd.count);

这在用于 MKAnnotations 的 MKMapKit 中效果很好,但在 MapBox 中没有效果。有人知道为什么会这样吗?

谢谢!

4

0 回答 0