iOS Debugging Fundamentals, Episode 4: Inspecting Variables | Kodeco

This content was released on Apr 27 2021. The official support period is 6-months from this date.

View the values stored in your properties and constants while your app is paused. Use debugger commands to change the state of your app while debugging.


This is a companion discussion topic for the original entry at https://www.kodeco.com/18770184-ios-debugging-fundamentals/lessons/4

Hi Felipe,
I’m wondering while I type po task.completed = false in the console, the compiler said “Publishing changes from within view updates is not allowed, this will cause undefined behavior.” And indeed I use po task.completed to check the Bool, and it’s still true.
But, after resume, the triangle on the second row was gone… So weird right? I’m confusing.

The error is really kind of giving a hint as to why things work unexpectedly or in an undefined behavior.

What is likely happening is you try to change the value of task.completed to false and, because you are doing this in a breakpoint set during the view’s update, it doesn’t do it immediately but shows changed after a a bit of time, or after continuing execution and hitting another breakpoint. :slight_smile:

I understand, it does work like this.
Thanks for your reply. By the way, I enjoyed working with Detective Pikachu. :smile:

You’re welcome :slight_smile: glad you’re enjoying the course!