properly handle notifications

This commit is contained in:
Justin R. Miller
2014-02-10 14:13:12 -08:00
parent 0157e4f140
commit d9f4b07c93

View File

@@ -130,12 +130,17 @@ class MBXMapView
[self.view addGestureRecognizer:quickZoom];
}
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startRender) name:MBXNeedsRenderNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startRender:) name:MBXNeedsRenderNotification object:nil];
displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(render:)];
[displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
}
- (void)startRender:(NSNotification *)notification
{
[self startRender];
}
- (void)startRender
{
[NSObject cancelPreviousPerformRequestsWithTarget:self];