我正在申请,我收到了EXC_BAD_ACCESS错误。
CODE
@interface DNProjectsCategory : DNCategory {
NSArray *projects;
}
@property(nonatomic, retain) NSArray *projects;
@end
而且:
@implementation DNProjectsCategory
@synthesize projects;
// MEM
- (void)dealloc {
[projects release];
[super dealloc];
}
// INIT.
- (id)init {
if (self = [super init]) {
title = NSLocalizedString(@"PROJECTS", nil);
isSubCategory = NO;
// Initialize projects
//!!LINE 32 IS HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
projects = [NSArray arrayWithContentsOfFile:DNPROJECTSFILE];
}
return self;
}
// CATEGORIES
- (NSArray *)subCategories {
NSMutableArray *projectsArray = [[[NSMutableArray alloc] init] autorelease];
for (NSDictionary *project in projects) {
DNCategory *projectCategory = [[DNCategory alloc] initWithTitle:[project valueForKey:@"title"]
subCategories:nil
isSubCategory:YES];
[projectsArray addObject:projectCategory];
[projectCategory release];
}
return projectsArray;
}
CONTENTS OF DNPROJECTSFILE
见。
CONSOLE & INSTRUMENTS
这是科索尔在跑时所说的话(SNSZombie被允许):
run
[Switching to process 41257]
Running…
2010-10-09 23:32:36.899 Done[41257:a0f] *** -[CFString isKindOfClass:]: message sent to deallocated instance 0x1001caab0
sharedlibrary apply-load-rules all
这里是乌克兰航天局试验中所说的:
Zombie Messaged
向地址:0x10012af80发送了目标C电文。
Stack Trace
0 CoreFoundation _CFRuntimeCreateInstance
1 CoreFoundation __CFStringCreateImmutableFunnel3
2 CoreFoundation CFStringCreateWithBytes
3 CoreFoundation _uniqueStringForCharacters
4 CoreFoundation getString
5 CoreFoundation parseXMLElement
6 CoreFoundation parseXMLElement
7 CoreFoundation parseArrayTag
8 CoreFoundation parseXMLElement
9 CoreFoundation parsePListTag
10 CoreFoundation parseXMLElement
11 CoreFoundation _CFPropertyListCreateFromXMLStringError
12 CoreFoundation _CFPropertyListCreateWithData
13 CoreFoundation CFPropertyListCreateFromXMLData
14 Foundation _NSParseObjectFromASCIIPropertyListOrSerialization
15 Foundation +[NSArray(NSArray) newWithContentsOf:immutable:]
16 Foundation +[NSArray(NSArray) arrayWithContentsOfFile:]
17 Done -[DNProjectsCategory init] /Users/rsonic/Developer/Done/DNProjectsCategory.m:32
18 Done -[DNBindingsController categories] /Users/rsonic/Developer/Done/DNBindingsController.m:18
19 Foundation -[NSObject(NSKeyValueCoding) valueForKey:]
20 Foundation -[NSObject(NSKeyValueCoding) valueForKeyPath:]
21 AppKit -[NSBinder valueForBinding:resolveMarkersToPlaceholders:]
22 AppKit -[NSArrayDetailBinder _refreshDetailContentInBackground:]
23 AppKit -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:]
24 AppKit -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:]
25 AppKit loadNib
26 AppKit +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:]
27 AppKit +[NSBundle(NSNibLoading) loadNibNamed:owner:]
28 AppKit NSApplicationMain
29 Done main /Users/rsonic/Developer/Done/main.m:13
30 Done start
QUESTION
我确实不知道如何确定这一双重释放。 就我所知,除<代码>dealloc外,在任何地方均不发放<代码>项目。 有些人能否帮助我? 感谢。