- スレッド #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.dylib CFRunLoopServiceMachPortmach_msg + 56 frame #2: 0x33672422 CoreFoundation
+ 126 フレーム #3: 0x3367115a CoreFoundation__CFRunLoopRun + 882 frame #4: 0x335f44dc CoreFoundation
CFRunLoopRunSpecific + 300 フレーム #5: 0x335f43 + 308 フレーム #7: 0x30e8ca90 Foundation _NSThread__mainCFRunLoopRunInMode + 104 frame #6: 0x30e8cbc8 Foundation
-[NSThread main] + 72 frame #8: 0x30f205a0 Foundation
+ 1048 フレーム #9: 0x3709bc1c libsystem_c.dylib`_pthread_start + 320
私は ASINetworkQueue を使用しておらず、URL の配列を使用しており、正常に呼び出される requestFinished: メソッドを実装しています。リクエストが応答されない場合、クラッシュが発生しました。
誰か助けてくれませんか?
サンプル コード スニペット:
クラス A (Wrapper クラスは 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:);