コードからメモリ リークを取り除こうとして問題が発生しています。以下のコードでは、「configurationArray = [[NSArray arrayWithContentsOfFile:controllerConfigurationFilePath] preserve];」という行でメモリ リークが発生します。ただし、retain を削除するとアプリケーションがクラッシュし、retain を autorelease に変更するとクラッシュが発生します。
ありがとう、ウィリアム
-(NSArray*)decodeConfigurationFile:(NSString*)fileName{
NSArray* configurationArray = [[NSArray alloc] init];
NSString *controllerConfigurationFilePath = [[NSBundle mainBundle] pathForResource:fileName ofType:@"plist"];
if (controllerConfigurationFilePath != nil) {
// returns array of items storing the data for form
configurationArray = [[NSArray arrayWithContentsOfFile:controllerConfigurationFilePath] retain];
}
// returns fields dictionary objects from plist into an array
return [[configurationArray objectAtIndex:0] objectForKey:@"fields"];
}