【问题标题】:long long int in ObjCObjC 中的 long long int
【发布时间】:2010-12-22 10:31:06
【问题描述】:

我正在使用这个 NSURLConnection 委托方法

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
    long long rdata = [response expectedContentLength];
    NSLog(@"Response Length : %lld", rdata);    
}

它总是显示-1

long long 变量的格式说明符是什么?

谢谢

【问题讨论】:

    标签: c objective-c integer long-integer


    【解决方案1】:

    来自expectedContentLength 上的文档:

    返回值

    接收者的期望 内容长度,或 NSURLResponseUnknownLength 如果 长度无法确定。

    NSURLResponseUnknownLengthis equals to -1。您是否尝试过检查内容长度标头?您连接的服务器可能使用chunked transfer encoding,因此内容长度不可用。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-05-08
    • 1970-01-01
    • 2016-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-12
    相关资源
    最近更新 更多