回答
您可以创建项目文件上右键点击属性列表中的文件,选择新的文件,并选择资源,这样的 -
您还可以创建通过代码属性列表文件像这样 -
创建一个新文件 -
#define FilePath [@"~/Documents/Demo.plist" stringByStandardizingPath]
NSArray *array = [NSArray arrayWithObjects:obj1,obj2,obj3,nil];
NSData *data = [NSPropertyListSerialization dataFromPropertyList:array format:NSPropertyListXMLFormat_v1_0 errorDescription:nil];
[data writeToFile:FilePath atomically:YES];
要阅读plist文件 -
NSData *data = [NSData dataWithContentsOfFile:FilePath];
NSPropertyListFormat format;
NSArray *array = [NSPropertyListSerialization propertyListFromData:data mutabilityOption:NSPropertyListImmutable format:&format errorDescription:nil];
obj1 = [array objectAtIndex:0];
obj2 = [array objectAtIndex:1];
obj3 = [array objectAtIndex:2];
感谢您的回复,它非常有用。 – 2012-02-07 04:09:19
如果答案可以帮助你,那么你应该接受它,这样它也可以对其他用户有所帮助。 – saadnib 2012-02-07 04:18:57
在Xcode,
右键 - >新文件 - >资源选项卡 - >属性列表文件。
感谢您的回复...... – 2012-02-07 04:07:14
@SampathKumar。 Wlecome。接受它,如果它解决您的问题 – Vignesh 2012-02-07 04:08:55
- 1. 创建一个plist iPhone SDK
- 2. 在iPhone中更新值plist
- 3. 创建的Plist
- 4. 如何在android中的eclipse中创建plist文件?
- 5. 创建从一个plist中
- 6. Xcode 4创建.plist
- 7. 从plist创建NSArray
- 8. 创建plist文件
- 9. 如何创建iphone
- 10. 在Xcode中创建plist文件
- 11. 在Java中创建二进制plist?
- 12. 在Rails 3中创建plist 3
- 13. 在NSString中从PLIST创建字典
- 14. IOS在plist中创建字典列表
- 15. 如何在iphone中创建组合框?
- 16. 如何在iphone中创建图库
- 17. Swift - 使用创建的plist
- 18. 如何在plist中添加新行
- 19. iphone代码 - 如何在标签栏中创建更新标志?
- 20. 如何在xcode中创建plist文件4.3.2
- 21. 如何在iphone中保存plist文件中的值?
- 22. 如何在asp.net中创建新的Asp.Net_SessionId
- 23. 如何在Blackberry中创建新的TextArea
- 24. 如何在C++中创建新的objectc?
- 25. 如何在Gerrit中创建新的Patchset?
- 26. 如何更新.plist中的Integervalue?
- 27. 从plist数组创建NSArray
- 28. 创建一个plist文件
- 29. 使用Java创建plist
- 30. NSSring从plist创建NSArray
早上好?哈哈该死!它的晚上8点32分在加利福尼亚! – iProRage 2012-02-07 04:32:08