You're absolutely correct. That is completely and totally a typo on my part. The good news is that the provided Xcode project is using an NSTextField and not a NSTextView. So, I got the code right, but I made a typo in my article.

Nevertheless, I do thank you for pointing that out to me and I have just sent off an email to the editors at O'Reilly requesting a change in the text of the article if possible.