4
我一直在爲此奮戰48小時,並且在沒有用處的情況下搜索所有論壇。 我使用NSURLConnection
來異步下載一系列網頁文件。它在下載幾個文件後隨機崩潰,其中的數量並不固定。NSURLConnection導致訪問失敗崩潰
請參閱下面的調用堆棧:
#0 0x35b634f4 in objc_msgSend
#1 0x3527c2ca in CFEqual
#2 0x3532e750 in __CFBasicHashStandardEquateKeys
#3 0x35330514 in ___CFBasicHashFindBucket_Linear
#4 0x3527c07c in CFBasicHashFindBucket
#5 0x3527bf5c in CFDictionaryGetValue
#6 0x31d15cb4 in HTTPMessage::copyConstantHeaderFieldValue
#7 0x31d6526c in URLRequest::copyConstantHeaderFieldValue
#8 0x31d606f8 in HTTPProtocol::getCacheStoragePolicy
#9 0x31d62cd0 in HTTPProtocol::updateForHeader
#10 0x31d64524 in HTTPProtocol::performHeaderRead
#11 0x31d64bf8 in HTTPProtocol::httpReadStreamEvent
#12 0x352c4302 in _signalEventSync
#13 0x352c427c in _cfstream_shared_signalEventSync
#14 0x352ed294 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
#15 0x352ef0e2 in __CFRunLoopDoSources0
#16 0x352f0058 in __CFRunLoopRun
#17 0x352970c2 in CFRunLoopRunSpecific
#18 0x35296fd0 in CFRunLoopRunInMode
#19 0x30a1f31c in +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]
#20 0x309ef618 in -[NSThread main]
#21 0x30a75146 in __NSThread__main__
計算器上它的確是與發送請求重定向問題上看到此之前線程之後。解決方案建議有執行
- (NSURLRequest *)connection:(NSURLConnection *)connection
willSendRequest:(NSURLRequest *)request
redirectResponse:(NSURLResponse *) redirectResponse
{
return request;
}
我做到了,但仍然崩潰在那裏。 另外,崩潰前的行爲是,willSendRequest
被調用兩次,並且沒有其他委託方法被調用此請求。它在NSURLResponse
內部崩潰。
仍然遇到問題 幫助任何人? – Vamshi 2010-06-25 07:24:40
嗨 沒有人對此有任何線索,或者只是不想回答新用戶? – Vamshi 2010-06-26 06:58:12
忘了補充一點,這個問題發生在使用iOS 4.0的iPhone上 不會發生在3.0 – Vamshi 2010-06-28 08:57:34