I wasn’t able to get this to work as detailed in the book using a MacOS VM.
Cutting and pasting verbatim from the book I would get this error:
po [$rdi setHidden:!(BOOL)[$rdi isHidden]];
error: expression failed to parse:
error: <user expression 362>:1:2: use of undeclared identifier '$rdi'
[$rdi setHidden:!(BOOL)[$rdi isHidden]];
But when I refactored the command to this:
po [$arg1 setHidden:!(BOOL)[$arg1 isHidden]]; [CATransaction flush]
I got the results in the book.
Happy coding!