嗨,我正在开发一个应用程序,其中我需要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)
内存分配和内存泄漏的屏幕截图是:

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