1

I'm overlaying the mapview and using RegexKitLite. I couldn't make it work. I've downloaded .m and .h files and added to the project. Also I tried, adding libicucore.dylib or libicucore.A.dlib or adding -licucore to other compiler flags field. Still getting the error:

2012-04-01 19:38:04.633 sennerdeysen[907:15803] -[__NSCFString stringByMatching:capture:]: unrecognized selector sent to instance 0x88b6a00 2012-04-01 19:38:04.634 sennerdeysen[907:15803] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString stringByMatching:capture:]: unrecognized selector sent to instance 0x88b6a00'

Any idea?

Latest Xcode but the sdk is 4.3

Without ARC or anything else that iOS 5.0 SDK provides.

Here's the function in which I make a call to stringbymatching method:

-(NSArray*) calculateRoutesFrom:(CLLocationCoordinate2D) f to: (CLLocationCoordinate2D) t {
NSString* saddr = [NSString stringWithFormat:@"%f,%f", f.latitude, f.longitude];
NSString* daddr = [NSString stringWithFormat:@"%f,%f", t.latitude, t.longitude];

NSString* apiUrlStr = [NSString stringWithFormat:@"http://maps.google.com/maps?output=dragdir&saddr=%@&daddr=%@", saddr, daddr];

NSURL* apiUrl = [NSURL URLWithString:apiUrlStr];

NSError *error;    
NSString *apiResponse=[NSString stringWithContentsOfURL:apiUrl encoding:NSASCIIStringEncoding error:&error];

if(apiResponse)
{
    NSString* encodedPoints = [apiResponse stringByMatching:@"points:\\\"([^\\\"]*)\\\"" capture:1L];
    NSLog(@"%@",encodedPoints);
    return [self decodePolyLine:[encodedPoints mutableCopy]];
}
else 
{

    UIAlertView *alertView=[[[UIAlertView alloc]initWithTitle:@"Hata" 
                                                      message:@"Rota çizilemedi. Lütfen daha sonra tekrar deneyiniz." 
                                                     delegate:nil 
                                            cancelButtonTitle:@"Tamam" 
                                            otherButtonTitles:nil] autorelease];
    [alertView show];
    return nil;
}    

}

Hasan Can Saral
  • 2,950
  • 5
  • 43
  • 78

0 Answers0