我是新來的Nimbus。現在我的應用程序正在試圖通過這個代碼來檢索4張圖片:爲什麼不調用我的nimbus didImageLoad方法?
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];
我知道我的循環工作,因爲我看到自己的四的NSLog的正確輸出。但是,我只獲得第一張圖片。 networkImageViewDidStartLoad僅被調用一次,也沒有調用LoadImage或networkImageViewDidFailLoad。我認爲didLoadImage永遠不會被調用是很奇怪的。決不。我知道我有數據,因爲我使用CharlieProxy(很棒的應用程序順便說一句,非常值50美元),它顯示響應數據包中的圖像數據。
所以我評論了這一點,我委託的:
[[Nimbus networkOperationQueue] setMaxConcurrentOperationCount:1];
正如你所期望的,我得到4調用networkImageViewDidStartLoad,仍然爲零didLoadImage或networkImageViewDidFailLoad。
這裏是我的請求頭(從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
和這裏的響應頭,呈現出 「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...)
我現在有點摸不着頭腦。我的服務器顯然是返回圖像數據,但我的應用程序只是沒有得到它。有任何想法嗎?