Permalink
Browse files

Now handes more kml files

  • Loading branch information...
1 parent f050e56 commit eea47f0c1a6cf62c2e9e54188502ccd7820a2869 @below below committed May 9, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 FTLocationSimulator/FTLocationSimulator.m
@@ -53,7 +53,14 @@ - (void)fakeNewLocation {
inRange:NSMakeRange(0, fakeLocationsFile.length)
capture:1
error:NULL];
- fakeLocations = [[coordinatesString componentsSeparatedByString:@" "] retain];
+ NSScanner *scanner = [NSScanner scannerWithString:coordinatesString];
+ while ([scanner isAtEnd] == NO) {
+ NSString *coordinate = nil;
+ [scanner scanUpToCharactersFromSet:[NSCharacterSet whitespaceAndNewlineCharacterSet] intoString:&coordinate];
+ if (fakeLocations == nil)
+ fakeLocations = [[NSMutableArray alloc] init];
+ [(NSMutableArray*)fakeLocations addObject:coordinate];
+ }
[fakeLocationsFile release];
if([[NSUserDefaults standardUserDefaults] objectForKey:@"FakeLocationsUpdateInterval"])

0 comments on commit eea47f0

Please sign in to comment.