I am trying using Xcode debug more efficiently. I realised some extra features which I have ever done before. From my understanding left side of debug console called String Summary ( please correct me if i wrong). I watched the WWDC videos but could not see the direct approaches to this section
var robGlobal = Player(name: "Rob", health: 10, energy: 10)
robGlobal.someFunction() // in viewdidload
struct Player {
var name: String
var health: Int
var energy: Int
func balance(_ x: inout Int, _ y: inout Int) {
let sum = x + y
x = sum / 2
y = sum - x
}
}
func someFunction() {
var robLocal = Player(name: "Rob", health: 10, energy: 10)
balance(&robLocal.health, &robLocal.energy) // put the breakpoint here
}
If I click the right click of the mouse; It appears an option "View memory of ... ". After next steps I added the screen shot and made 4 section to ask better question.
Q1: Why there is a 10 line ? 16F34BDA0 is obvious. it correspond to name but what about 16F34BDD7 second line and so on ?
Q2: Would you mind if you explain with detail section 1-2-3 ?
Q3: Also name and robLocal is showing same place in the memory ? Is that possible ? - then why health and energy has different ?
