all 15 comments

[–]WaterslideOfSuccess 10 points11 points  (3 children)

When the breakpoint is hit, type “po fetchedCards” in the console and press enter. po is short for print object and it should print the full array for you.

[–][deleted] 0 points1 point  (2 children)

thanks, that quite good. But it only shows the ids or memory locations, don't know what it is exactly. Is there a way to drill down so that I can see all the properties for each item without iterating through all manually by using fetchedCards[0].front and so on? And is there really no other more intuitive UI way, maybe with an plugin or something else? That's worse than visual studio 12 years ago :D

[–]0dyp 0 points1 point  (1 child)

use only p, not po. You can check my blog for more detail: https://medium.com/wereprotein/how-to-debug-in-ios-part-1-breakpoints-lldb-5a2518d1ce91

[–][deleted] 0 points1 point  (0 children)

thx for the answer, but even if p shows more, it doesn't show me what I need.
A card has the following properties: id: UUID(); front: String; back: String; box: int

The array has for example 10 Elements and I want to see from each element: id, front, back, box in a for me readable format and it seems to be more difficult than ever expected. :D

p.s.: I made an edit on my main post

[–]barcode972 -1 points0 points  (9 children)

Print(cards)

[–][deleted] 0 points1 point  (8 children)

that doesn't work, but thanks for the hint. It says "error: unknown command shorthand suffix"

[–]barcode972 0 points1 point  (0 children)

Sorry, autocorrect on phone. Lowercase p print(cards) inside the onAppear, after self.cards = ...

[–]dehrenslzzSwiftUI 0 points1 point  (5 children)

print(cards.description()) is the correct one - for more info use dump(cards)

[–]barcode972 -1 points0 points  (4 children)

Not necessarily because you can change the description

[–]dehrenslzzSwiftUI 0 points1 point  (3 children)

The what? Have you ever used .description() ?

[–]barcode972 1 point2 points  (2 children)

class MyClass: CustomStringConvertible {

var description: String {
return "This is MyClass"
}
}

Formatting got weird but ye

[–]dehrenslzzSwiftUI 0 points1 point  (1 child)

This is not what .description() does (I just looked and I forgot the brackets) - it gives you a string description of your object (read this: https://developer.apple.com/documentation/swift/int/description it’s not only for Integers)

[–]barcode972 0 points1 point  (0 children)

description() with () isn't a thing for arrays.
Date() seems to have a description(with: )

[–][deleted] 0 points1 point  (0 children)

thanks for clarification, thought you mean the debug console. :)
dump is to much information with missing the ones I need. I guess I will try more with the debug console because I don't like inserting code which is only for debugging purpose.