Re: categories question...
Re: categories question...
- Subject: Re: categories question...
- From: Jonathan Jackel <email@hidden>
- Date: Sun, 13 Jul 2003 09:03:24 -0400
On Sunday, July 13, 2003, at 05:43 AM, Philip George wrote:
@implementation NSLayoutManager (myLayoutManagerAdditions)
- (id)init {
if (self = [super init]) {
// do some post-init initting
// for now though, it's literally just this comment
}
return self; // here's where i get the EXC_BAD_ACCESS
}
@end
As Gerard said, you are replacing NSLayoutManager's init method, so
your call to [super init] is actually calling NSObject's init.
NSLayoutManager probably does some setting up of its instance variables
(retaining some things, perhaps) and since you tell it not to, when
your code (or AppKit) tries to get to those variables, it goes kablooey.
The simplest thing would be to subclass NSLayoutManager to override
init. Then calling super will do what you want. You can leave your
category in place. Those methods will work in your subclass. Or you
can move those methods to your subclass.
Jonathan
_______________________________________________
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.