创建 Numbers 文件并使用 iPad 上的 Numbers 打开它
我想做一个在其他操作系统上非常简单的任务,但在 iOS 上却不是那么简单。也就是说,我想创建文件并在 Numbers 中打开它。 我可以使用 UIDocumentInteractionController 预览文件,然后将其提供给用户,让他/她打开它。 在我看来,这是一个相当合理的解决方案。但是,我需要提供正确的文件格式。我认为 CSV 和 XLS 的实现是合理的,并且很可能会起作用,但如果可能的话,我仍然希望以本机数字格式进行。但是,我找不到有关此文件格式的任何信息。
基本上,此任务是将数据导出到另一个应用程序,然后进一步使用它们。
I would like to do a task that is quite simple on other OS, but it is not so trivial on iOS. Namely, I want to create file and open it in Numbers.
I can preview the file with UIDocumentInteractionController and then offer it to user that he/she opens it.
THis seems to me quite a reasonable solution. However, I need to offer proper file format. I suppose CSV and XLS would be reasonable to implement and it would most probably work, but I would still like to do it in native Numbers format if possible. However, I can't find any info about this file format.
Basically, this task is about exporting data to another app and then working further with them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不知道有哪个库可以创建本机 Numbers 文件。然而,有些库允许创建 XLS 文件。由于 Numbers 完全支持 XLS,因此这可能是正确的选择。
有一个可以在 iPhone 上运行的商业库(售价 200 美元):http://www.libxl.com/< /a>
至于免费的XLS库,我只知道xlwt,一个Python模块。您可以设置一个 Web 服务,在服务器端使用 xlwt 为您的应用程序创建 XLS 文件。
I don't know of a library that can create native Numbers files. There are hoewever some libraries that allow creating XLS files. Since Numbers fully supports XLS, this is probably the way to go.
There is a comercial library available that might work on the iPhone (costs $200): http://www.libxl.com/
As for free XLS libraries, I only know xlwt, a Python module. You could set up a webservice that creates an XLS file for your app, using xlwt on the server side.
如果您想将信息传递给 Numbers,您也可以使用 CSV 文件。如果您使用 CSV 文件,则必须注意一些事项。有两种 CSV 文件:逗号分隔版本(用于英语国家)和分号分隔版本(用于欧洲大陆)。
例如,逗号分隔的 CSV 文件如下所示:
第二种 CSV 文件以分号分隔并使用逗号作为小数点。它们看起来像这样:
在 Macintosh 上,Numbers 需要不同的格式,具体取决于区域设置。如果您将区域设置为美国,它将期待第一种。如果你选择德国,那就会是第二种。
我不知道 iPad 上的 Numbers 需要什么样的文件。
另一种选择是使用复制和粘贴。尝试将制表符分隔的文本复制到剪贴板中。
If you want to pass information to Numbers, you can probably also use CSV files. If you use CSV files, you must be aware of some things. There are two kinds of CSV files: the comma separated version (used in english speaking countries) and the semicolon separated (used in continental europe).
The comma separated CSV files look for example like this:
The second kind of CSV files are semicolon separated and use a comma as decimal mark. They look like this:
On the Macintosh, Numbers expects a different format depending on the Region setting. If you have your Region set to the US, it will expect the first kind. If you choose Germany, it will expect the second kind.
I don't know what kind of files Numbers on the iPad expects.
Another alternative would be using copy and paste. Try to copy tab separated text into the clipboard.
我希望这可以帮助你。我已经联系了 libxl 团队,他们回复了他们的 iPhone 库的演示版链接: http://www.libxl.com/download/libxl-iphone.zip
I hope this may help you. I've contacted libxl team and they responded with the link to the demo version of their iPhone library: http://www.libxl.com/download/libxl-iphone.zip