dyld:找不到符号:错误如何解决此问题
|
我有以下代码(如下所示),其中我使用“ 0”来连接和解析响应字符串。但是我收到以下错误:
dyld: Symbol not found: _CFXMLNodeGetInfoPtr
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
我已经为此进行了很长的工作,无法解决此错误。
我已经导入了json.h和ASIHTTPRequest.h,所有这些文件仍然无法修复错误。
@implementation Websample1ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
dataWebService = [[NSMutableData data] retain];
NSMutableURLRequest *request = [[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@\"https://www.googleapis.com/customsearch/v1?key=AIzaSyDzl0Ozijg2C47iYfKgBWWkAbZE_wCJ-2U&cx=017576662512468239146:omuauf_lfve&q=lectures&callback=handleResponse\"]]retain];
NSURLConnection *myConnection = [NSURLConnection connectionWithRequest:request delegate:self];
[myConnection start];
}
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
[dataWebService setLength:0];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
[dataWebService appendData:data];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSString *responseString = [[NSString alloc] initWithData:dataWebService encoding:NSUTF8StringEncoding];
NSLog(@\"Response: %@\",responseString);
[responseString release];
[dataWebService release];
}
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
NSLog(@\"Error during connection: %@\", [error description]);
}
//class 2
@implementation WebJson
//parse JSON
- (void)requestCompleted:(ASIHTTPRequest *)request
{
NSString *responseString = [request responseString];
NSDictionary *dictionary = [responseString JSONValue];
NSDictionary *dictionaryReturn = (NSDictionary*) [dictionary objectForKey:@\"request\"];
NSString *total = (NSString*) [dictionaryReturn objectForKey:@\"totalResults\"];
NSLog(@\"totalResults: %@\", total);
NSString *search = (NSString*) [dictionaryReturn objectForKey:@\"searchTerms\"];
NSLog(@\"searchTerms: %@\", search);
int count = [[dictionaryReturn objectForKey:@\"count\"] intValue];
NSLog(@\"count: %d\", count);
}
没有找到相关结果
已邀请:
6 个回复
舜辉
是错误的,我不会感到惊讶,因为它看起来不属于iOS SDK,请查看其路径... 我猜应该是这样的:
宠封钞轰
谷起
,但是仅在ѭ77.0所指定的iOS 7.0(和Mac OSX 10.9)及更高版本中可以使用
。
壬驴拿歪竞
棠媳鳖
凄嘛姥