Without seeing more code, it's hard to say what is happening. There are some tips in this thread that can help you: fooobar.com/questions/58039 / ...
Maybe you are not calling this from the main thread? Does your view have a custom implementation of drawRect: :? Could you put a breakpoint there to see what size the missing rectangle has? Right size?
What if you just create a vanilla NSView with, say, a green background color and add it to your holder view? It works? If so, something is wrong with the implementation of your CustomView .
Without seeing more code, it is difficult to identify the problem.
source share