Cocoa NSTextView setHidden

Filed under cocoa, objective c, os x, programming, and quickie.

If you’re trying to hide an NSTextView without success, be aware that setHidden only hides the NSTextView itself – it doesn’t hide the enclosing NSScrollView. Instead of doing this :

[myTextView setHidden:YES];

you need to do :

[[myTextView enclosingScrollView] setHidden:YES];

If you enjoyed this post, please follow us on twitter or subscribe to our feed!