【发布时间】:2010-07-28 19:49:47
【问题描述】:
我正在尝试将以下 NSString api 调用转换为 NSURL 对象:
http://beta.com/api/token="69439028"
这是我设置的对象。我已经用反斜杠转义了引号:
NSString *theTry=@"http://beta.com/api/token=\"69439028\"";
NSLog(@"theTry=%@",theTry);
NSMutableURLRequest *url = [[NSURL alloc] URLWithString:theTry];
NSLog(@"url=%@",url);
每次我运行这个,我都会收到这个错误:
2010-07-28 12:46:09.668 RF[10980:207] -[NSURL URLWithString:]: unrecognized selector sent to instance 0x5c53fc0
2010-07-28 12:46:09.737 RF[10980:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURL URLWithString:]: unrecognized selector sent to instance 0x5c53fc0'
有人可以告诉我如何正确地将这个字符串转换为 NSURL 吗?
【问题讨论】:
标签: iphone objective-c