Merge branch 'develop' into ios7
Showing
3 changed files
with
13 additions
and
14 deletions
@@ -67,16 +67,10 @@ static RMConfiguration *RMConfigurationSharedInstance = nil; | @@ -67,16 +67,10 @@ static RMConfiguration *RMConfigurationSharedInstance = nil; | ||
67 | 67 | ||
68 | [request setValue:[[RMConfiguration configuration] userAgent] forHTTPHeaderField:@"User-Agent"]; | 68 | [request setValue:[[RMConfiguration configuration] userAgent] forHTTPHeaderField:@"User-Agent"]; |
69 | 69 | ||
70 | - NSError *internalError = nil; | ||
71 | - | ||
72 | - NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:&internalError]; | 70 | + NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:error]; |
73 | 71 | ||
74 | if ( ! returnData) | 72 | if ( ! returnData) |
75 | - { | ||
76 | - *error = internalError; | ||
77 | - | ||
78 | return nil; | 73 | return nil; |
79 | - } | ||
80 | 74 | ||
81 | return [[[self class] alloc] initWithData:returnData encoding:enc]; | 75 | return [[[self class] alloc] initWithData:returnData encoding:enc]; |
82 | } | 76 | } |
@@ -117,13 +111,13 @@ static RMConfiguration *RMConfigurationSharedInstance = nil; | @@ -117,13 +111,13 @@ static RMConfiguration *RMConfigurationSharedInstance = nil; | ||
117 | 111 | ||
118 | RMLog(@"reading route-me configuration from %@", path); | 112 | RMLog(@"reading route-me configuration from %@", path); |
119 | 113 | ||
120 | - NSString *error = nil; | 114 | + NSError *error = nil; |
121 | NSData *plistData = [NSData dataWithContentsOfFile:path]; | 115 | NSData *plistData = [NSData dataWithContentsOfFile:path]; |
122 | 116 | ||
123 | - _propertyList = [NSPropertyListSerialization propertyListFromData:plistData | ||
124 | - mutabilityOption:NSPropertyListImmutable | 117 | + _propertyList = [NSPropertyListSerialization propertyListWithData:plistData |
118 | + options:NSPropertyListImmutable | ||
125 | format:NULL | 119 | format:NULL |
126 | - errorDescription:&error]; | 120 | + error:&error]; |
127 | 121 | ||
128 | if ( ! _propertyList) | 122 | if ( ! _propertyList) |
129 | { | 123 | { |
@@ -79,6 +79,8 @@ | @@ -79,6 +79,8 @@ | ||
79 | _infoDictionary = (NSDictionary *)[NSJSONSerialization JSONObjectWithData:[tileJSON dataUsingEncoding:NSUTF8StringEncoding] | 79 | _infoDictionary = (NSDictionary *)[NSJSONSerialization JSONObjectWithData:[tileJSON dataUsingEncoding:NSUTF8StringEncoding] |
80 | options:0 | 80 | options:0 |
81 | error:nil]; | 81 | error:nil]; |
82 | + if ( ! _infoDictionary) | ||
83 | + return nil; | ||
82 | 84 | ||
83 | _tileJSON = tileJSON; | 85 | _tileJSON = tileJSON; |
84 | 86 | ||
@@ -174,7 +176,8 @@ | @@ -174,7 +176,8 @@ | ||
174 | 176 | ||
175 | - (void)dealloc | 177 | - (void)dealloc |
176 | { | 178 | { |
177 | - dispatch_release(_dataQueue); | 179 | + if (_dataQueue) |
180 | + dispatch_release(_dataQueue); | ||
178 | } | 181 | } |
179 | 182 | ||
180 | #pragma mark | 183 | #pragma mark |
@@ -37,7 +37,8 @@ | @@ -37,7 +37,8 @@ | ||
37 | if (self.mapScrollViewDelegate) | 37 | if (self.mapScrollViewDelegate) |
38 | [self.mapScrollViewDelegate scrollView:self correctedContentOffset:&contentOffset]; | 38 | [self.mapScrollViewDelegate scrollView:self correctedContentOffset:&contentOffset]; |
39 | 39 | ||
40 | - [super setContentOffset:contentOffset]; | 40 | + if ( ! isnan(contentOffset.x) && ! isnan(contentOffset.y)) |
41 | + [super setContentOffset:contentOffset]; | ||
41 | } | 42 | } |
42 | 43 | ||
43 | - (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated | 44 | - (void)setContentOffset:(CGPoint)contentOffset animated:(BOOL)animated |
@@ -45,7 +46,8 @@ | @@ -45,7 +46,8 @@ | ||
45 | if (self.mapScrollViewDelegate) | 46 | if (self.mapScrollViewDelegate) |
46 | [self.mapScrollViewDelegate scrollView:self correctedContentOffset:&contentOffset]; | 47 | [self.mapScrollViewDelegate scrollView:self correctedContentOffset:&contentOffset]; |
47 | 48 | ||
48 | - [super setContentOffset:contentOffset animated:animated]; | 49 | + if ( ! isnan(contentOffset.x) && ! isnan(contentOffset.y)) |
50 | + [super setContentOffset:contentOffset animated:animated]; | ||
49 | } | 51 | } |
50 | 52 | ||
51 | - (void)setContentSize:(CGSize)contentSize | 53 | - (void)setContentSize:(CGSize)contentSize |
-
Please register or login to post a comment