I need help. I have a SpriteKit Scene and use the update function for changing a property of the Scene. This property is used for a Circle View in the ZStack. When I am tapping the Button, there is a memory leak detected in the leakage tool of Xcode. Is this a bug or why could this happen? The button only is printing something on the console.
The Leak is: NSXPCConnection remoteObjectProxyWithErrorHandler
If I change the button to:
then there is appearing this library between the QuartzCore in the Malloc 64 Byte entry:
"AXCoreUtilities"
I really hope that there is anybody who knows what's going on here. Thanks for any answers.
Code Block import SwiftUI import SpriteKit
Code Block class Game: SKScene, ObservableObject{ @Published var lenght: CGFloat = 1 var up: Bool = false func change(){ if self.lenght > 200 { up = false }else if (self.lenght < 5){ up = true } up ? (self.lenght += 1) : (self.lenght -= 1) } override func update(_ currentTime: TimeInterval) { self.change() } }
Code Block struct ContentView: View { @ObservedObject var game = Game() var body: some View { ZStack{ SpriteView(scene: game) Circle().frame(width: game.lenght, height: game.lenght) .foregroundColor(.white) Button("hello"){ print("hello") } .frame(width: 50, height: 20) .foregroundColor(.black) .background(Color.blue) } } }
The Leak is: NSXPCConnection remoteObjectProxyWithErrorHandler
If I change the button to:
Code Block Button("hello"){ print("hello") game.lenght = 30 }
then there is appearing this library between the QuartzCore in the Malloc 64 Byte entry:
"AXCoreUtilities"
I really hope that there is anybody who knows what's going on here. Thanks for any answers.