[英]Why aren't my nimbus didImageLoad methods being called?
I'm new to Nimbus. 我是Nimbus的新手。 Right now my app is trying to retrieve 4 images via this code: 现在,我的应用正在尝试通过以下代码检索4张图像:
for (int i=minFoto; i<=maxFoto; i++) {
NINetworkImageView* networkImageView = [self networkImageView];
NSString *resourceURL = [NSString stringWithFormat:@"%@registration/rest/users/account_get_foto/%@?fotoId=%d", baseURL, ssid, i];
NSLog(resourceURL);
[networkImageView setPathToNetworkImage:resourceURL
forDisplaySize: CGSizeMake(50, 50)
contentMode: networkImageView.contentMode];
I know my loop is working because I see all four NSLog's come out correctly. 我知道我的循环正在工作,因为我看到所有四个NSLog都正确输出了。 However, I am only getting the first image. 但是,我只得到第一张图片。 networkImageViewDidStartLoad is only being called once and neither didLoadImage or networkImageViewDidFailLoad is being called. networkImageViewDidStartLoad仅被调用一次,并且didLoadImage或networkImageViewDidFailLoad均未被调用。 I think it is odd that didLoadImage is never being call. 我认为didLoadImage从未被调用很奇怪。 Never. 决不。 I know I have the data because I'm using CharlieProxy (great app BTW, well worth the $50) and it shows the image data in the response packets. 我知道我有数据,因为我正在使用CharlieProxy(很棒的应用程序BTW,非常值得50美元),它在响应数据包中显示图像数据。
So I commented this out of my delegate: 所以我从我的代表中评论了这一点:
[[Nimbus networkOperationQueue] setMaxConcurrentOperationCount:1];
And as you might expect, I'm getting 4 calls to networkImageViewDidStartLoad, and still zero to didLoadImage or networkImageViewDidFailLoad. 如您所料,我收到4个对networkImageViewDidStartLoad的调用,而对didLoadImage或networkImageViewDidFailLoad的调用仍然为零。
Here are my request headers (from CharlieProxy) 这是我的请求标头(来自CharlieProxy)
GET /registration/rest/users/account_get_foto/fdbc2222-7b75-4ff4-b111-623e951e5b00?fotoId=134 HTTP/1.1
Host: -------------:8080
User-Agent: Ferret/1.0 CFNetwork/548.0.3 Darwin/11.2.0
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: keep-alive
and here's the response headers, showing a "200 OK" 这是响应标题,显示“ 200 OK”
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Powered-By: Servlet/3.0; JBossAS-6
Content-Type: image/*
Content-Length: 461109
Date: Tue, 31 Jan 2012 21:12:33 GMT
âPNG (png data deleted...)
I'm a little puzzled now. 我现在有点困惑。 My server is clearly returning the image data, but my app just isn't getting it. 我的服务器显然正在返回图像数据,但我的应用程序却没有得到它。 Any ideas? 有任何想法吗?
Well, I found it. 好吧,我找到了。 Might as well put the answer in for future googlers. 也可能为将来的Google员工提供答案。
My networkImageView had gone out of scope and was ARC'd. 我的networkImageView已超出范围,并且已进行ARC。 Funny, I thought I had saved it away, but that code was partially commented out! 有趣的是,我以为我已将其保存下来,但是该代码被部分注释掉了!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.