【问题标题】:How To Store Data On Icloud in xamarin form.ios如何以 xamarin form.ios 在 Icloud 上存储数据
【发布时间】:2021-05-10 13:59:39
【问题描述】:

enter image description hereThis 下面我想存储在iClouds IOS上的数据,我该怎么做,是否可以存储在iClouds上,请给我一个代码

enter image description here

这是我想要存储在 iCloud IOS 上的数据,我该怎么做,是否可以存储在 iCloud 上,请给我一个代码

【问题讨论】:

标签: xamarin xamarin.forms xamarin.ios icloud


【解决方案1】:

要保存“MyFun item”数据,建议将数据序列化后保存为json文件或xml文件。

对于 JSON 序列化,您可以安装 Nuget 包Newtonsoft.Json。更多信息,您可以参考这个document

或者 XML 序列化,你可以创建一个 XmlSerializer Class 的实例来序列化和反序列化对象到 XML 文档中。

这里有一些相关的 SO 线程可以参考。

How to write a JSON file in C#?

Serialize an object to XML

如果你有序列化数据,如评论中提到的,你可以下载官方demoXamarin.iOS - Introduction to iCloud,然后传给MonkeyDocument.DocumentString

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-29
    • 2014-08-09
    • 1970-01-01
    • 2015-04-27
    • 2015-12-13
    • 1970-01-01
    相关资源
    最近更新 更多