作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
这有点基础;我正在尝试检索 iPhone 应用程序的 http 数据。
我有 www.myhost.com/test.html 上面写着
<array><string>test</string><string>test2</string></array>
然后我有
NSURL *baseURL = [NSURLRLWithString:@"http://www.myhost.com/test.html"];
NSArray *array = [NSArray arrayWithContentsOfURL:baseURL];
NSLog(@"%@", [array description]);
不断返回 (null)。我错过了什么?谢谢!
最佳答案
它可能应该是一个完整的 plist 格式(带有 doctype 等等)
创建适当 plist 的最简单方法是使用“Property List Editor.app”
旁注:NSLog(@"%@", [array description]);
与 NSLog(@"%@", array); 相同
关于iphone - arrayWithContentsOfURL 的正确用法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1869210/
这有点基础;我正在尝试检索 iPhone 应用程序的 http 数据。 我有 www.myhost.com/test.html 上面写着 testtest2 然后我有 NSURL *baseURL =
当我调用 [NSArray arrayWithContentsOfFile:] 时,我得到了 nil。 NSURL *fileURL = [NSURL URLWithString:className
我太笨了,不知道这个问题的答案 - 有人确切知道答案吗? NSMutableArray *happyDictionaryEntries; @property (nonatomic, retain) N
我是一名优秀的程序员,十分优秀!