365Cocoa

A snippet of Objective-C code per day, 365 days long.
Written by Pieter Omvlee, developer and owner of Bohemian Coding.

Mar 24

Day 26: Don’t call it contentView

I’m putting the drawing series aside again, for a few days of short tips. Today’s is a bit obscure, but it has bit me a few times.

Dont call an instance variable in an NSBox subclass contentView. It’ll clash with another variable that is apparently already defined there. You’ll get no errors but just unexpected behaviour.