gpt4 book ai didi

iphone - 迪尔德 : Symbol not found: error how to resolve this issue

转载 作者:太空狗 更新时间:2023-10-30 03:39:28 26 4
gpt4 key购买 nike

我有以下代码(在下面给出),我在其中使用 NSURLConnection 来连接和解析响应字符串。但是我收到以下错误:

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

最佳答案

dyld错误是由库链接(而不是代码)丢失或错误引起的。

仔细检查您的框架链接,不要犹豫删除/重新创建链接,注意您从中获取框架的 iOS 版本。 (通常使用 Xcode 提供的列表,不要浏览文件)

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

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

关于iphone - 迪尔德 : Symbol not found: error how to resolve this issue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6344560/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com