gpt4 book ai didi

iphone - TTURL响应为零

转载 作者:行者123 更新时间:2023-12-03 19:38:19 25 4
gpt4 key购买 nike

我正在尝试在我的应用程序中实现一个简单的TTURLRequest。我对 Three20 框架还很陌生。我主要想要 TTURLRequestTTImageView 来实现出色的缓存功能。

我的委托(delegate)中有以下代码:

- (void)requestDidFinishLoad:(TTURLRequest*)request {
TTURLDataResponse *response = request.response;
// Stuff to process response.data
}

response 始终为零。我不明白我做错了什么。我查看了应用程序支持目录,它正在使用正确的数据创建缓存文件,所以我知道它正在得到响应。我做错了什么?

最佳答案

调试了您的代码 - 实际上您必须创建一个响应对象并将其添加到请求中,然后再发送请求:

NSString *url = @"http://twitter.com/statuses/user_timeline/samsoffes.json?count=1";
TTURLRequest *theRequest = [[TTURLRequest alloc] initWithURL:url delegate:self];
theRequest.response = [[[TTURLDataResponse alloc] init] autorelease];
[theRequest send];

人们会认为请求将负责创建响应,但 Three20 的东西则不然。

关于iphone - TTURL响应为零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1441693/

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