小编h.k*_*han的帖子

Watch kit App:由于内存错误而终止

嗨,我正在开发一个应用程序,其中我需要chache 50张图像(所有图像的大小是2.5 MB),它正在追逐图像,但也因Apple应用程序崩溃而在Apple Watch App中增加了10 MB的内存.

Xcode在xCode中给出错误"来自调试器的消息:由于内存错误而终止"

我使用的代码如下:

 for (var i : Int  = 1; i<26; i++) {

            let filenameHuman = NSString(format: "human_%d", i )
            let filenameZombie = NSString(format: "zombie_%d", i )

            var imageHuman : UIImage! =  UIImage(named: filenameHuman as String)
            var imageZombie : UIImage! =  UIImage(named: filenameZombie as String)

            WKInterfaceDevice.currentDevice().addCachedImage(imageZombie, name: filenameZombie as String)

            WKInterfaceDevice.currentDevice().addCachedImage(imageHuman, name: filenameHuman as String)

        }

        NSLog("Currently cached images: %@",WKInterfaceDevice.currentDevice().cachedImages)
Run Code Online (Sandbox Code Playgroud)

内存分配和内存泄漏的屏幕截图是:

在此输入图像描述

请帮助,提前致谢.

ios swift watchkit

5
推荐指数
1
解决办法
1007
查看次数

使用iCloud同步Sqlite数据库?

我有一个应用程序已经在应用程序商店,它使用Sqlite数据库.现在我想制作另一个版本,其中包括iCloud同步,现在问题是,是否有任何教程或第三方代码与iCloud同步sqlite数据库,因为我搜索了很多但没有得到任何可用的答案?提前致谢.

sqlite iphone ios icloud

4
推荐指数
1
解决办法
1802
查看次数

标签 统计

ios ×2

icloud ×1

iphone ×1

sqlite ×1

swift ×1

watchkit ×1