- 線程#7:TID = 0x2403,0x351b9010 libsystem_kernel.dylib
mach_msg_trap + 20 frame #0: 0x351b9010 libsystem_kernel.dylib
mach_msg_trap + 20 幀#1:0x351b920c libsystem_kernel.dylibmach_msg + 56 frame #2: 0x33672422 CoreFoundation
CFRunLoopServiceMachPort + 126 幀#3:0x3367115a的CoreFoundation__CFRunLoopRun + 882 frame #4: 0x335f44dc CoreFoundation
CFRunLoopRunSpecific + 300 幀#5:0x335f43a4的CoreFoundationCFRunLoopRunInMode + 104 frame #6: 0x30e8cbc8 Foundation
+ [NSURLConnection的(裝載程序)resourceLoadLoop:] + 308 幀#7:0x30e8ca90基金會-[NSThread main] + 72 frame #8: 0x30f205a0 Foundation
_NSThread__main + 1048 幀#9:0x3709bc1c libsystem_c .dylib`_pthread_start + 320
我沒有使用ASINetworkQueue並通過一個urls數組來使用,並且我實現了requestFinished:方法,它被調用的很好。當請求沒有被迴應時,我收到了崩潰。常見asihttprequest runrequests碰撞
你能請一些人幫我嗎?
示例代碼段:
A類(包裝類擴展ASIHTTPRequest):
ASIHTTPRequest *httpRequest;
- (id)initWithURL:(NSString *)anURL errorInfo:(NSError **)error {
if (self = [super init]) {
NSURL *httpURL = [NSURL URLWithString:anURL];
httpRequest = [self createASIRequest:httpURL];
didFinishSelector = @selector(requestFinished:);
didFailSelector = @selector(requestFailed:);
return self;
}
}
- (void)dealloc {
if (httpRequest) {
[httpRequest clearDelegatesAndCancel];
[httpRequest release];
httpRequest = nil;
}
[super dealloc];
}
- (ASIHTTPRequest *)createASIRequest:(NSURL *)url {
ASIHTTPRequest *request = [[ASIHTTPRequest requestWithURL:url] retain];
request.delegate = self;
return request;
}
B類:
Request in loop:
Class A *d = [[Class A alloc] initWithURL:url errorInfo:&pError];
d.didFinishSelector = @selector(responseHandler:);
d.didFailSelector = @selector(responseHandler:);
請解釋更多或者張貼一些代碼 – Shardul
@Shardul代碼片段已添加。請給我建議。 – Bharath
@Bharath我也得到同樣的錯誤在這裏...任何建議。 – maheswaran