RegexKitLite运行时崩溃

时间:2012-04-01 16:43:08

标签: objective-c cocoa runtime-error regexkitlite

我正在覆盖mapview并使用RegexKitLite。我无法让它发挥作用。我已经下载了.m和.h文件并添加到项目中。我也试过,添加libicucore.dylib或libicucore.A.dlib或将-licucore添加到其他编译器标志字段。仍然得到错误:

  

2012-04-01 19:38:04.633 sennerdeysen [907:15803] - [__ NSCFString stringByMatching:capture:]:无法识别的选择器发送到实例0x88b6a00   2012-04-01 19:38:04.634 sennerdeysen [907:15803] * 由于未捕获的异常'NSInvalidArgumentException'终止应用程序,原因:' - [__ NSCFString stringByMatching:capture:]:发送到无法识别的选择器实例0x88b6a00'

有什么想法吗?

最新的Xcode但是sdk是4.3

没有ARC或iOS 5.0 SDK提供的任何其他内容。

这是我调用stringbymatching方法的函数:

-(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;
}    

}

0 个答案:

没有答案