写入主捆绑目录。是允许的吗? [英] Write in Main Bundle directory. Is it allowed?

查看:130
本文介绍了写入主捆绑目录。是允许的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很确定在iOS中无法写入主要的Bundle ...例如:

I was pretty sure that writing in the main Bundle isn't possible in iOS ... for example an operation like :

NSString *path = [[NSBundle mainBundle] pathForResource:@"Data" ofType:@"plist"];
.....something
[xmlData writeToFile:path atomically:YES];

为什么 Apple的文档使用这个确切的代码?

Why does the first example in Apple's documentation use this exact code?

推荐答案

该示例适用于OS X,其权限不如iOS严格。

The example is for OS X, which isn't quite as strict with permissions as iOS.

如果你能够在Mac App Store应用程序包中完成更长时间(如果你现在可以的话),我会感到惊讶。

I'd be surprised if you are able to do that for much longer (if you can at all now) in a Mac App Store application bundle, though.

可能值得提交有关文档的错误。

It could be worth filing a bug regarding the documentation.

这篇关于写入主捆绑目录。是允许的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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