dyld:找不到符号:错误如何解决此问题 [英] dyld: Symbol not found: error how to resolve this issue

查看:259
本文介绍了dyld:找不到符号:错误如何解决此问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码(如下所示),我使用 NSURLConnection 来连接和解析响应字符串。但是我收到以下错误:

I have the following code (given below) where I am using NSURLConnection for connecting and parsing the response string. But I am getting the following error:

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

I我一直在努力解决这个错误。

I have been working on this for a long itme without being able to fix this error.

我已经导入了json.h和ASIHTTPRequest.h,所有这些文件,仍然是,它没有修复错误。

I have imported json.h and ASIHTTPRequest.h, all those files, still, it has not fixed the error.

@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);
}


推荐答案

dyld 错误是由于库<链接缺失或错误引起的,而不是代码。

dyld errors are caused by a missing or a bad library linking, not code.

仔细检查您的框架链接,不要犹豫,删除/重新创建您正在使用框架的iOS版本的链接,保管(通常使用Xcode提供的列表,不要浏览文件)

Double check your frameworks links, do not hesitate to delete/recreate the links, taking care of iOS version you are taking your frameworks from. (usually use the Xcode provided list, do not browse for files)

在你的情况下,我不会惊讶于链接 /System/Library/Frameworks/Security.framework 是一个错误,因为它看起来不像属于iOS SDK,看着它的路径......

In your case I won't be surprised that linking /System/Library/Frameworks/Security.framework is an error, since it doesnt look like belonging to iOS SDK, looking at its path...

我想应该是这样的: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator<Version>.sdk/System/Library/Frameworks/Security.framework

这篇关于dyld:找不到符号:错误如何解决此问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆