Question

I am just starting to learn drawing procedures for the IPhone, but something confuses me. If I start a new view-based application, and establish a new view class, associate that with the view that came with the application, then drawRect, placed in that new view class, seems to work.

But why can't I just establish my drawing routines directly in the view controller for the view: I've tried it, and drawRect just doesn't get invoked when I use setNeedsDisplay.

Thanks in advance for any help.

John Doner

Was it helpful?

Solution

drawRect is a method from UIView and not from UIViewController, that's why it's not being called.

From https://stackoverflow.com/a/1053770/127311

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top