#1306 - Explicitly scheduling NSURLConnections in mainRunLoop so that delegates and connections stay connected.

This commit is contained in:
Brad Leege
2015-04-20 18:56:42 -05:00
parent fbd610695a
commit 96a6371fa0

View File

@@ -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