This is called the focus ring, and it visually indicates which view is the first responder for key events.
If you do not want it to be displayed, you can use a method -[NSView setFocusRingType:]with a constant NSFocusRingTypeNone. It is also customizable in Interface Builder.
source
share