这个警告仅发生在xcode8、ios10.0以上版本的DEBUG模式下。原因不明。进入到一个有MKMapView的界面后,在退出的时候就会弹这个警告。
解决:
- (void)dealloc
{
#if DEBUG
// Xcode8/iOS10 MKMapView bug workaround
static NSMutableArray* unusedObjects;
if (!unusedObjects)
unusedObjects = [NSMutableArray new];
[unusedObjects addObject:self.viewMap];
#endif
}