Re: More on drawRect not getting called
Re: More on drawRect not getting called
- Subject: Re: More on drawRect not getting called
- From: Quincey Morris <email@hidden>
- Date: Sun, 24 Jul 2011 12:03:03 -0700
Looks like today is my day for grouchy responses. "I wish I hadn't chosen this week to give up sniffing glue." ;)
On Jul 24, 2011, at 11:41, Tom Jeffries wrote:
> Jens, I'm sorry if my naming conventions confuse you. I've been programming
> for 27 years on a wide variety of operating systems, and I'm afraid
> following Cocoa naming conventions is not high on my list.
It needs to be high on your list, for several technical reasons.
a. It confuses us, because we follow the conventions. If you're trying to use this list to get clarification on something, confusing us doesn't help you much.
b. It confuses you. See below.
c. Starting with the Clang LLVM 3.0 compiler, the structure of (some) method names (including capitalization) has become a new syntax feature (method families).
> I thought [SequeraStepWindow awakeFromNib] makes it obvious that
> SequeraStepWindow is a class.
'awakeFromNib' is an instance method, not a class method. If 'SequeraStepWindow' is a class (that is, an object of type 'Class'), you don't send 'awakeFromNib' to it. If it's an instance (that is, an object of some class you defined), then you should use the correct terminology *before* climbing on your high horse.
> Is there a way to use that syntax with a
> variable? If so, Objective C gets a major thumbs down.
Of course there is. If 'someObject' is a variable of an object type, then [someObject someMethod] is valid syntactically. That's how Objective-C gets (part of) its dynamism.
> Draw Notes calls other routines to get the correct information and ends
> with:
>
> CGContextBeginPath (noteContext);
>
> CGContextAddEllipseInRect(noteContext, noteBox);
>
> CGContextFillPath(noteContext);
>
> CGContextDrawPath(noteContext, kCGPathStroke);
>
>
> drawRect is supposed to do the actual screen drawing. It does it perfectly
> when called during program startup. It is not called again.
You still seem to be trying to *call* something that will eventually *call* 'drawRect:'. Several people have pointed out to you that this is the wrong approach.
> The program compiles without warnings. Obviously I dealt with that level
> before posting a question here.
You'd be surprised how often people post code here that *can't* compile without warnings. In the absence of an explicit statement from you, it *isn't* obvious, just unknown. That's why Jens asked.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden