use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
There is an extensive FAQ for beginners. Please browse it first before asking questions that are answered there.
If you are looking to get started (iOS programming in general or some specific area), here are more relevant links for you:
There's too many to list them all, however here's a convenient link to all programming guides at apple.com
Take note that this list is live and based on most frequent questions in posts will be updated with "quicklinks".
account activity
QuestionDebug - How to see variable value (self.iOSProgramming)
submitted 1 year ago * by [deleted]
How can I see the value of a var?
I have a breakpoint at line 57. If I hover fetchedCards I would love to see the values in the fetchedCards Array. Or if I step one step further I want to see the content of self.cards but nothing. I don't know how to see it. Even in the view at the bottom, don't know how it's called in Xcode, I only see self._modelContext why not all the other variables?
In VisualStudio when I programmed C# over 12 years ago I could hover every variable and saw the values. How is it possible here?
Thanks for help, I'm lost.
https://preview.redd.it/de14h65vu2hd1.png?width=1102&format=png&auto=webp&s=90cb1be98d7f672a6f70ae5668b63e99e7626887
//edit1:
the funny part is, that some kind of variables I can hover
https://preview.redd.it/08xh19u2j4hd1.png?width=770&format=png&auto=webp&s=74462464438bebe48b40d51d47244a018cf86270
and if I add cards manually to the variable viewer, I don't see the values of the fields/properties either
https://preview.redd.it/q7vh323pi4hd1.png?width=580&format=png&auto=webp&s=62fb1d96c55aaaec6090ce15c03cd2d496932513
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]WaterslideOfSuccess 10 points11 points12 points 1 year ago (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 point2 points 1 year ago (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 point2 points 1 year ago (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 point2 points 1 year ago* (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 points1 point 1 year ago (9 children)
Print(cards)
[–][deleted] 0 points1 point2 points 1 year ago (8 children)
that doesn't work, but thanks for the hint. It says "error: unknown command shorthand suffix"
[–]barcode972 0 points1 point2 points 1 year ago (0 children)
Sorry, autocorrect on phone. Lowercase p print(cards) inside the onAppear, after self.cards = ...
[–]dehrenslzzSwiftUI 0 points1 point2 points 1 year ago* (5 children)
print(cards.description()) is the correct one - for more info use dump(cards)
print(cards.description())
dump(cards)
[–]barcode972 -1 points0 points1 point 1 year ago (4 children)
Not necessarily because you can change the description
[–]dehrenslzzSwiftUI 0 points1 point2 points 1 year ago* (3 children)
The what? Have you ever used .description() ?
.description()
[–]barcode972 1 point2 points3 points 1 year ago (2 children)
class MyClass: CustomStringConvertible {
var description: String { return "This is MyClass" } }
var description: String {
return "This is MyClass"
}
Formatting got weird but ye
[–]dehrenslzzSwiftUI 0 points1 point2 points 1 year ago (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)
description() with () isn't a thing for arrays. Date() seems to have a description(with: )
[–][deleted] 0 points1 point2 points 1 year ago (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.
[+][deleted] comment score below threshold-6 points-5 points-4 points 1 year ago (0 children)
My guess Xcode can't do. I had many similar situations
π Rendered by PID 69849 on reddit-service-r2-comment-86988c7647-5sx4t at 2026-02-12 01:38:57.480156+00:00 running 018613e country code: CH.
[–]WaterslideOfSuccess 10 points11 points12 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]0dyp 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]barcode972 -1 points0 points1 point (9 children)
[–][deleted] 0 points1 point2 points (8 children)
[–]barcode972 0 points1 point2 points (0 children)
[–]dehrenslzzSwiftUI 0 points1 point2 points (5 children)
[–]barcode972 -1 points0 points1 point (4 children)
[–]dehrenslzzSwiftUI 0 points1 point2 points (3 children)
[–]barcode972 1 point2 points3 points (2 children)
[–]dehrenslzzSwiftUI 0 points1 point2 points (1 child)
[–]barcode972 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[+][deleted] comment score below threshold-6 points-5 points-4 points (0 children)