From 96a6371fa006b908ef70123b6c632f9b0ad47eb2 Mon Sep 17 00:00:00 2001 From: Brad Leege Date: Mon, 20 Apr 2015 18:56:42 -0500 Subject: [PATCH] #1306 - Explicitly scheduling NSURLConnections in mainRunLoop so that delegates and connections stay connected. --- platform/ios/MGLMapboxEvents.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 67108bff4..e4b422fe8 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -398,8 +398,9 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; [request setHTTPBody:jsonData]; // Send non blocking HTTP Request to server - NSURLConnection *conn = [NSURLConnection connectionWithRequest:request delegate:strongSelf]; - [conn start]; + NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:strongSelf startImmediately:NO]; + [connection scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; + [connection start]; // [NSURLConnection sendAsynchronousRequest:request // queue:nil