私のアプリケーションは完全にリークがありません (私はそう思います)。だからここにあります:
mainPath = [[NSBundle mainBundle] bundlePath];
levelConfigPlistLocation = [mainPath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.plist",CATEGORY]];
levelConfig = [[NSDictionary alloc] initWithContentsOfFile:levelConfigPlistLocation];
そして、これが私がそれを使用する方法です:
NSString *question = [[[levelConfig objectForKey:LEVELSETSTRING]objectForKey:LEVELSTRING]objectForKey:@"question"];
questionLabel = [CCLabelTTF labelWithString:question dimensions:CGSizeMake(820.0f,360.0f) alignment:UITextAlignmentCenter fontName:@"helvetica" fontSize:32.0f];
questionLabel.position = ccp(screenSize.width/2-30 ,screenSize.height);
questionLabel.color = ccc3(255,255,255);
[self addChild:questionLabel z:5];
と:
NSString *answer = [[[levelConfig objectForKey:LEVELSETSTRING]objectForKey:LEVELSTRING]objectForKey:@"answer"];
for (int i=0; i < [answer length]; i++)
{
NSRange r = NSMakeRange(i, 1);
NSString *ichar = [answer substringWithRange:r];
[characters addObject:ichar];
}
そして、-dealloc
私はそれをリリースします:
[levelConfig release];
楽器は私に次のリークを示しています:
ダブルクリックすると、常に同じ行が表示されます。
これは明らかに levelconfig の漏れです...しかし、どうすればよいですか?