2011-04-13 58 views
0

我無法找到有關three20文檔標題任何獲得標題:如何從TTURLResponse(具體TTURLJSONResponse)

http://api.three20.info/interface_t_t_u_r_l_j_s_o_n_response.php http://api.three20.info/protocol_t_t_u_r_l_response-p.php

我看到一些關於頭在TTURLRequest:

http://api.three20.info/interface_t_t_u_r_l_request.php

雖然我不能訪問這些標題 - 他們返回零。 (另外 - 我想響應標題,而不是請求標頭)。

那麼如何從TTURLJSONRequest訪問響應頭呢?

回答

1

子類TTURLJSONResponse,並實現

- (NSError*)request:(TTURLRequest*)request processResponse:(NSHTTPURLResponse*)response data:(id)data { 
    // do your stuff with response - with the dictionary [response allHeaderFields]; 
    return [super request:request processResponse:response data:data]; 
}