Objective c iOS-从文件初始化数组

Objective c iOS-从文件初始化数组,objective-c,ios,Objective C,Ios,我正在尝试从文件初始化数组 这是包含字符串数组的文件。。这是xml文件 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <string>cccc

我正在尝试从文件初始化数组

这是包含字符串数组的文件。。这是xml文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<string>ccccc</string>
<string>ddddddd</string>
</array>
</plist>
调试时,我看到应用程序文件名是正确的,并且该文件存在。 但是,阵列中没有填充任何对象


我在这里做错了什么?

在分配之前,您正在使用
temp

NSMutableArray *temp = [temp initWithContentsOfFile:appFile];
应该是:

NSMutableArray *temp = [NSMutableArray arrayWithContentsOfFile:appFile];

谢谢,太好了。。在文档中没有发现类方法。
NSMutableArray *temp = [NSMutableArray arrayWithContentsOfFile:appFile];