Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
properly handle notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
incanus committed Feb 10, 2014
1 parent 0157e4f commit d9f4b07
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ios/MBXViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,17 @@ - (void)viewDidLoad
[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];
Expand Down

0 comments on commit d9f4b07

Please sign in to comment.