如何在Xcode 4中将plist的根对象类型更改为NSArray [英] How do you change a plist's root object type to NSArray in Xcode 4

查看:88
本文介绍了如何在Xcode 4中将plist的根对象类型更改为NSArray的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Xcode 4中创建的plist中将根对象类型更改为NSArray?
它默认为一种NSDictionary,但我找不到改变它的方法。

how do you change the root object type to an NSArray in a plist created in Xcode 4? It defaults to a type of NSDictionary, but I can't find a way to change it.

推荐答案

你在Xcode4中无法做到这一点。你可以做的是手工创建一个plist,一个数组作为根对象或者一个现有的(当然这个应该是一个空的,因为用行转换一个没有意义)并通过替换<$ c来修改它$ c>< dict /> 带< array /> (您可能必须先将其转换为XML plist,如果它是二进制的)。一旦根对象是一个数组,Xcode似乎保持这种方式,当你选择添加一行时,它会立即将一个数字作为键(因为当然没有别的可能)。也许您应该在 https://bugreport.apple.com 提交功能请求

You cannot do that in Xcode4. What you can do is either create a plist by hand with an array as root object or take an existing one (of course this one should be an empty one, since converting one with rows makes no sense) and modify it by replacing <dict/> with <array/> (you may have to first convert it to an XML plist, if it is a binary one). Once the root object is an array, Xcode seems to keep it that way and when you select to add a row, it will immediately put a number as key (since nothing else is possible, of course). Maybe you should file a feature request at https://bugreport.apple.com

这篇关于如何在Xcode 4中将plist的根对象类型更改为NSArray的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆