On Jul 28, 2011, at 6:31 PM, Tom Jeffries wrote:

> I appreciate all the comments on the problem I had with drawRect not
> getting called.  I finally extracted the code that was not working and
> put it in a new program, and it worked perfectly.  I'm still not sure
> whether there was a problem in my code or if I unearthed a problem in
> Cocoa, but I'm now adding the rest of the original program to the new
> program, and the graphics are working.

I can't help but doubt it was a Cocoa bug. You admitted previously that you 
were new to OS X programming, and that is the most likely cause of the problem, 
I'm afraid.

> I understand that people who program in only one environment want to
> see code that matches the way they learned to program.  That causes
> problems for those of us who work in multiple environments, some of
> which have a whole different set of "rules".  However, maybe it's a
> sign that software development is still at an early stage that some
> environments insist on Data and others insist on data.  I do think
> it's important to keep in mind the difference between code and data,
> and some of the suggestions I got seemed to show some lack of clarity
> in that area. Confusing the two may work in certain specific
> environments, but it reflects a misunderstanding of the way computers
> actually work.  I think it's important to have an awareness of the
> difference.
> 
> Thanks again for your help.

With all due respect, assuming that those expecting a convention for a given 
environment must only be proficient in that environment is presumptive and a 
little rude. Conventions convey information. As you witnessed, it was difficult 
for people to understand what precisely your code was doing because you were 
violating several conventions that convey to the reader events that are 
occurring, like whether or not you're calling a method of a class or an 
instance of a class. That was important important in attempting to diagnose 
your problem.

Someone who works in multiple environments should be experienced enough to be 
more acutely aware of the usefulness of such conventions, especially when 
communicating with others. Attempting to shoehorn one's personal style across 
environments will only confuse those more experienced in each who are looking 
at your code.

The conversation that your "confusion" comment is in response to actually 
illustrated some major confusions on your part about sending messages to object 
references (the C pointer "myString" that you didn't consider to be a 
variable), the difference between a C function and an Objective-C method, and 
other object-oriented concepts the language is based on that are, I think, 
unnecessarily frustrating you.

Apple has an excellent Objective-C primer in their documentation:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html

Preston_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to