• 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: Looking for Cocoa source code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Looking for Cocoa source code


  • Subject: Re: Looking for Cocoa source code
  • From: Lance Bland <email@hidden>
  • Date: Thu, 6 Mar 2003 14:09:54 -0500

On Thursday, March 6, 2003, at 01:15 PM, David Remahl wrote:

> Apple is keeping the source to themselves, and this is actually good
> in some cases, since it enforces encapsulation and forces you to rely
> only on what is documented. The thing is, that the developer should
> not know exactly what he/she is overriding, since that can change in
> future implementations of the framework, and then break existing code.
>
> If you find problems in the documentation, file bugs against it at
> <http://bugreporter.apple.com>.

That is true to a point, but here is a good example of why it is not
good:

If you write a subclass of NSView and think you need to overload these
methods:

- (void)setFrameOrigin:(NSPoint)newOrigin;
- (void)setFrameSize:(NSSize)newSize;
- (void)setFrame:(NSRect)frameRect;

which one do you overload? all of them?

It might help to know that setFrame: calls setFrameSize: and
setFrameOrigin: to do its job.

Thus you need to overload setFrameSize: and setFrameOrigin: only. And
if you also overload setFrame: then you might be screwed because you
might do some things twice.

It pays to know the implementation details.

-lance

------------------------------------
Lance Bland
mailto:email@hidden
VVI Is The #1 Visual-Report Tool Developer For Mac OS X
http://www.vvi.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Looking for Cocoa source code
      • From: Scott Anguish <email@hidden>
    • Re: Looking for Cocoa source code
      • From: Raff <email@hidden>
    • Re: Looking for Cocoa source code
      • From: Neil Steiner <email@hidden>
    • Re: Looking for Cocoa source code
      • From: David Remahl <email@hidden>
References: 
 >Re: Looking for Cocoa source code (From: David Remahl <email@hidden>)

  • Prev by Date: Re: NSFileManager fileAttributesAtPath confusion
  • Next by Date: Re: Looking for Cocoa source code
  • Previous by thread: Re: Looking for Cocoa source code
  • Next by thread: Re: Looking for Cocoa source code
  • Index(es):
    • Date
    • Thread