0

plist から にデータをロードする際に問題がありNSMutableDictionaryます。シミュレーターでは、すべてが機能します。iPad に展開すると、最初にこの関数を呼び出すとすべてが機能しますが、この関数を 2 回目に呼び出すdictnil. 何が問題なのですか?

これが私の機能です:

- (NSMutableDictionary*) getDataFromPList: (NSString*) pList fromElement:(NSString*) element{ 
    NSString *ressourcePath = [[NSBundle mainBundle]resourcePath];
    NSString *filePath = [[NSString  stringWithFormat:@"%@/%@", ressourcePath, pList] retain];

    NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath];

    return [dict objectForKey:element];
}
4

0 に答える 0