
应用程序启动后,我注意到我的内存使用率略有上升.
我花了5个小时中的3个时间挖掘参考资料,用ARC学习强VS弱(绝对推荐读取中间体,比如我自己)
还有其他人遇到过这个问题吗?如果有的话有什么解释吗?这是我的GameVIEwController的一小部分:
class GameVIEwController: UIVIEwController {overrIDe func vIEwDIDLoad() { super.vIEwDIDLoad() if let scene = MainMenu(filenamed:"MainMenu") { // Configure the vIEw. let skVIEw = self.vIEw as! SKVIEw skVIEw.showsFPS = true skVIEw.showsNodeCount = true skVIEw.multipletouchEnabled = true skVIEw.showsPhysics = true /* Sprite Kit applIEs additional optimizations to improve rendering performance */ skVIEw.ignoresSiblingOrder = true /* Set the scale mode to scale to fit the window */ scene.scaleMode = .Fill //var GameSaveData = GameData() // Scene Config //scene.Landscape = "Test_Landscape" //scene.Area = "Start" skVIEw.presentScene(scene) }else{ print("Couldn't Load Game Scene") }} 正如你所看到的,我在这里并没有做任何与众不同的事情.我会发布我的gamescene代码,但在我仍在观察内存泄漏的时候,它都被注释掉了.
解决方法 最终,出于贪图,我刚开始评论代码行,然后构建和分析,直到内存泄漏得到解决.原来我的GameVIEwController.swift文件,
skVIEw.showsPhysics = true
是罪魁祸首.这有点像一个新的错误,因为我在<中没有看到这个问题. IOS 9.2
总结以上是内存溢出为你收集整理的ios – .showsPhysics的内存泄漏全部内容,希望文章能够帮你解决ios – .showsPhysics的内存泄漏所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)