Re: Question about categories
Re: Question about categories
- Subject: Re: Question about categories
- From: Stephen Deken <email@hidden>
- Date: Sat, 2 Sep 2006 17:38:18 -0500
So, sinse I can't add onto a method... If I subclass it there are
several methods that return an object of its class. That wouldn't do
because then only the first object would have the extra methods that I
add. So... I tried overriding those methods like this:
It sounds like you want to do class posing. Try this -- subclass the
class you're working with, and override its init method so that it
calls [super init].
Then, somewhere early in your application -- usually in main() before
the NSApplication line -- call the class method poseAsClass on your
new class. For example, to change all NSExistingClass into
MyNeatClass, you would do:
[MyNeatClass poseAsClass:[NSExistingClass class]];
From then on, all calls to NSExistingClass's -[init] would actually
go through your MyNeatClass.
HTH,
Stephen Deken
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden