前言
hihi,勇敢的小伙伴儿们大家好,八月,来更博客了~tvOS开发的一些注意事项分享给大家~
正文
有能力的小伙伴儿们可以去官方文档了解一下App Programming Guide for tvOS
接下来说几个tvOS的特别之处。
1.Apple tvOS引入了一下几个特有的框架。
- TVMLJS。描述了C/S应用中用来加载TVML页面的JavaScript接口。见《TVJS Framework Reference》。
- TVMLKit。提供一种整合JavaScript和TVML的方法。见《TVMLKit Framework Reference》。
- TVServices。描述了如何为应用添加顶部扩展《TVServices Framework Reference》。
2.资源限制
Apple TV上的应用没有持久化的本地存储。
There's an inconsistency regarding the Documents folder: you can create files in it when you run your app in the Simulator. But on the actual Apple TV, it just fails.
虽然可以短暂存储在Caches或Temporary文件夹下,但是依然会被系统删除。
You can write data to the Caches directory and the data should stay there as long as your app is running. But when your app exits, that data could be deleted by the system, so be prepared for it to be gone when your app launches again.
这意味着每个应用都应该将数据存放在iCloud,并且通过一种用户体验较好的方式将它们获取到。