【发布时间】:2011-07-01 12:21:47
【问题描述】:
我正在后台线程中运行一些代码以从服务中获取文本文件。该代码在某些时候会触发一个委托。一旦调用了委托,它就会抛出 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.
【问题讨论】:
-
SIGABRT 通常意味着异常。日志中的信息是什么?
标签: iphone multithreading delegation