代码之家  ›  专栏  ›  技术社区  ›  Sam Soffes Jolly Roger

TTURL响应为零

  •  3
  • Sam Soffes Jolly Roger  · 技术社区  · 16 年前

    我正在尝试实现一个简单的 TTURLRequest 在我的应用程序中。我对Three20框架相当陌生。我主要想要 TTURLRequest TTImageView

    我的委托中有以下代码:

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

    response

    2 回复  |  直到 16 年前
        1
  •  6
  •   Steve Brewer    16 年前

    调试您的代码-在发送请求之前,您实际上必须创建响应对象并将其添加到请求中:

    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的东西没有。

        2
  •  0
  •       16 年前
    推荐文章