App偶尔会得到SIGKILL,似乎是stringWithContentsOfURL:encoding:error:

时间:2012-05-07 03:33:17

标签: objective-c macos

NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%@&output=csv", [temp stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]];
DLog(@"urlString:%@",urlString); //http://maps.google.com/maps/geo?q=Kebon%20Jeruk,Jakarta&output=csv
NSURL * Url= [NSURL URLWithString:urlString]; //http://maps.google.com/maps/geo?q=Kebon%20Jeruk,Jakarta&output=csv
// Getting a SIGKILL on the next line; the program aborts
NSString * result = [NSString stringWithContentsOfURL:Url encoding:NSASCIIStringEncoding error:nil];
DLog(@"Result:%@",result);

我不知道为什么我的Mac应用程序会收到SIGKILL;它只会偶尔发生一次。

我检查并检查并检查,没有任何意义。我在该行发送的所有论据都很好。

1 个答案:

答案 0 :(得分:0)

NSString *result = [NSString stringWithContentsOfURL:Url encoding:NSUTF8StringEncoding error:&error]

尝试尝试。