简体   繁体   English

为什么我的nimbus didImageLoad方法没有被调用?

[英]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.

相关问题 斯威夫特:为什么不调用我的UITextFieldDelegate方法? - Swift: Why aren't my UITextFieldDelegate methods being called? 我的 TableView 数据源函数没有被调用,我不知道为什么 - My TableView datasource functions aren't being called and I don't know why 在 iOS 13 中未调用应用程序委托方法 - App delegate methods aren't being called in iOS 13 不是每次都调用 AVCapturePhotoCaptureDelegate 方法 - AVCapturePhotoCaptureDelegate methods aren't being called every time 为什么我的 UITableDelegate 方法没有被调用? - Why are my UITableDelegate methods not being called? 为什么我的UISearchController委托方法没有被调用? - Why are my UISearchController delegate methods not being called? 委托方法没有被调用,看不清为什么 - Delegate methods not being called, can't see why 在将类添加为通知的观察者后未调用方法 - methods aren't getting called after adding class as observer for notifications 为什么不应用AVMutableVideoCompositionInstruction? - Why aren't AVMutableVideoCompositionInstruction's being applied? 为什么在iOS中没有调用view * Disappear方法? - Why are the view*Disappear methods not being called in iOS?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM