Re: Looking for Cocoa source code
Re: Looking for Cocoa source code
- Subject: Re: Looking for Cocoa source code
- From: Hamish Allan <email@hidden>
- Date: Fri, 7 Mar 2003 00:01:50 +0000
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday, March 6, 2003, at 02:09 PM, Lance Bland wrote:
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?
Are you not begging the question? If you think you need to overload
them all, presumably you have good reason for thinking so, in which
case you do need to.
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.
Do you mean screwed in the sense of, you're written duplicate code?
Then write setFrame: in terms of setFrameSize: and setFrameOrigin:,
just as you suspect Apple to have done. Now, you're duplicating their
code, but since they haven't guaranteed an internal relationship
between these three functions, that's the only way you can guarantee
whatever behaviour you need in the proposed situation where you need to
overload all three functions. Or do you mean screwed in some other
sense?
regards,
Hamish
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)
iD8DBQE+Z+Fy6gc2d//pELYRAvutAJ4hWJUFL1RISkEQYnXgpX28sctEQwCaAwDI
kz8oz10v0peu6zFpeAm26kU=
=S1cj
-----END PGP SIGNATURE-----
_______________________________________________
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.