如何将 NSUserDefaults.StandardUserDefaults 序列化为支持电子邮件的文本?
我使用 Monotouch 进行 iPhone/iPad 开发,并且有一个内置系统,用户可以在其中从应用程序提交错误报告。如果能捕获我存储在 NSUserDefaults.StandardUserDefaults 中的“设置”,这样我就可以看到它们的确切配置。
有人知道如何捕获 NSUserDefaults.StandardUserDefaults 并写入文本或文件以包含在电子邮件中吗?
谢谢。
I'm using Monotouch for iPhone/iPad development and I have a built in system where the user can submit a bug report from the app. It would be nice to capture their "settings" which I store in NSUserDefaults.StandardUserDefaults so I can see their exact configuration.
Anyone know how to capture the NSUserDefaults.StandardUserDefaults and write out to text or file to include in the e-mail?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将 NSUserDefaults 保存为 plist。在另一端解码可能更容易。
[编辑]
我不知道这是否有效。
或者只是循环浏览您的属性并将它们打印到文件中?
You could save the
NSUserDefaults
as a plist. Might be easier to de-code on the other end.[EDIT]
I have no idea if this will work.
Or just cycle through your properties and print them to a file?
我最终只是将 .plist 文件直接附加到电子邮件中,效果很好。
I ended up just attaching the .plist file directly to the e-mail and that worked just fine.