• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: More on drawRect not getting called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More on drawRect not getting called


  • Subject: Re: More on drawRect not getting called
  • From: Jens Alfke <email@hidden>
  • Date: Sun, 24 Jul 2011 10:45:09 -0700

On Jul 24, 2011, at 10:11 AM, Tom Jeffries wrote:

> + (BOOL) Play

It’s hard to tell what’s going on in the code when you’re not following Cocoa naming conventions. Methods should start with a lowercase letter (unless they begin with a common acronym like “URL”).

I’m very strongly in favor of prefixing (or postfixing) instance variables with something like “_” or “m_” to distinguish them from other variables. This makes it a lot easier to look at code and quickly identify what a variable is, as in these snippets. (It’s not a universal convention, though, although I will note that Apple strongly follows it in its own code.)

> [self DrawNotes]; // this is where the drawing takes place

Do you mean that the -DrawNotes method actually draws stuff? It shouldn’t; that should happen in -drawRect:.

> //[SequeraStepWindow awakeFromNib];
>
> //[SequeraStepWindow setNeedsDisplay: YES];

What is SequeraStepWindow? A class or a variable? It’s capitalized so I assume a class, but both of those are instance methods, so they won’t work when called on a class (and will generate compiler warnings.)

* Does your code build without warnings? If not, fix the warnings first. Very important; a lot of serious errors in Obj-C only get reported as warnings.
* Have you set an all-exceptions breakpoint? There are cases in which an exception thrown from your code can be caught by AppKit and not reported back to you, so it just looks as though nothing happens.

This is getting messy enough that maybe you should just upload a zip file of your whole project, or at least the relevant source files, and post the URL...

—Jens_______________________________________________

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

  • Follow-Ups:
    • Re: More on drawRect not getting called
      • From: Tom Jeffries <email@hidden>
References: 
 >More on drawRect not getting called (From: Tom Jeffries <email@hidden>)

  • Prev by Date: More on drawRect not getting called
  • Next by Date: Does anyone else dislike Xcode 4?
  • Previous by thread: More on drawRect not getting called
  • Next by thread: Re: More on drawRect not getting called
  • Index(es):
    • Date
    • Thread