[パーサー リリース] で断続的なクラッシュが発生しています。約 5% の確率で発生すると思いますが、解析しているデータはクラッシュごとに異なります。私は一生、理由を理解することはできません。
バグ レポートを Apple に提出する前に (運が良ければ、サンプル コードでは再現できません)、誰かこれに遭遇して、何が起こっているのか知っていますか?
NSData *d = [data copy]; // data is typically 2K-13K bytes
@synchronized (xmlParserLock) {
[[NSURLCache sharedURLCache] setMemoryCapacity:0];
[[NSURLCache sharedURLCache] setDiskCapacity:0];
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSXMLParser *parser = [[NSXMLParser alloc] initWithData:d];
[parser setDelegate:self];
[parser setShouldProcessNamespaces:NO];
[parser setShouldReportNamespacePrefixes:NO];
[parser setShouldResolveExternalEntities:NO];
[parser parse];
[parser release];
[pool release];
}
[d release];
[パーサー リリース] を指す gdb の「where」出力は次のとおりです。
#0 0x93d08d12 in xmlCharEncCloseFunc ()
#1 0x93cfc0e3 in xmlFreeParserInputBuffer ()
#2 0x93cfc08f in xmlFreeInputStream ()
#3 0x93cfbdac in xmlFreeParserCtxt ()
#4 0x961384d6 in -[NSXMLParser dealloc] ()
#5 0x00149de7 in -[MyParserClass parseResponse] (self=0x104e9f0, _cmd=0x1766dc) at /Users/mike/Documents/MyApp/Classes/MyParserClass.m:60
助けてくれてありがとう!