0
我需要從plist數組中提取數據並將其放入NSArray中。但它似乎沒有工作。從plist數組創建NSArray
這裏是我的主文件:
NSString *path = [[NSBundle mainBundle] pathForResource:@"htmlData" ofType:@"plist"];
NSMutableDictionary *tempDictionary = [[NSMutableDictionary alloc] initWithContentsOfFile:path];
dictionary = tempDictionary;
[tempDictionary release];
NSMutableArray *nameArray = [[NSMutableArray alloc] init];
nameArray = [dictionary objectForKey:@"tagName"];
self.sitesArray = nameArray;
[nameArray release];
我的plist文件。命名:htmlData.plist
<plist version="1.0">
<dict>
<key>tagName</key>
<array>
<string><html></string>
<string><body></string>
</array>
</dict>
</plist>
應該設置self.sitesArray
等於@"<html>", @"<body>, nil;
,但它不工作。
和下一個內存管理錯誤只在線路上......但在此之後它是兩行 – 2010-10-25 21:28:11
它現在工作,現在我刪除它!謝謝! – Jakir00 2010-10-25 21:28:30