gpt4 book ai didi

iOS 14 WidgetKit 可用内存

转载 作者:行者123 更新时间:2023-12-05 01:34:15 25 4
gpt4 key购买 nike

在网上搜索发现老版本的widgets有如下内存限制:

Respond appropriately to user interactions. Perform well (in particular, iOS widgets must use memory wisely or the system may terminate them).” The memory limit for the widget is 16 MB, so keep it simple and make sure to test out your widget for memory leaks

我想了解 iOS 14 的新版本中,可以使用的内存是相同的还是发生了变化。

我在文档中找不到任何内容。

我想在 Swift ui 中编写一个 WidgetKit ,但首先我想了解是否有任何限制。

谁能给我一些说明?

最佳答案

我会说内存限制是 30MB。我试图在 WidgetKit 内使用由 MKMapSnapshotter 生成的大图像,它在调用 completion 时因 EXC_RESOURCE RESOURCE_TYPE_MEMORY (limit=30 MB, unused=0x0) 而崩溃func getTimeline(in:completion:)。一旦我缩小了图像,它就可以正常工作了。

关于iOS 14 WidgetKit 可用内存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63883755/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com