我在后台线程中运行一些代码以从服务中获取文本文件。该代码在某些时候会触发一个委托。一旦调用了委托,它就会抛出 SIGABRT 错误,而且我的概念听起来也不令人信服。
在后台线程运行的代码:
- (void)FetchStores
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Fetch from service
NSString *serviceURL = @"http://../index.html";
NSURL *myURL = [NSURL URLWithString:serviceURL];
NSData *dataRep = [NSData dataWithContentsOfURL:myURL];
storesList = [[Stores alloc] init];
storesList.storesDelegate = self;
[storesList FetchWithNSData:dataRep];
[pool release];
}
storesList
一旦从服务中提取了所有商店,该对象将触发一个委托。委托被主线程中的函数捕获。
你有什么建议我做错了什么吗?
谢谢,
F。