Lloyd Dupont wrote: > Assertion failed: impostor->instance_size == super_class->instance_size, > file class.c, line 638 > > I'm kind of puzzled, couldn't you have new instance variable in a posing > subclass? > That's the whole advantage compare to categories...
Actually, the advantage is that you can override methods and call super instead of replacing the class' implementation or potentially conflicting with other categories. http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Classes/NSObject.html#//apple_ref/doc/uid/20000050-poseAsClass_ But maybe someone can find the time to update our documentation to clarify this issue. > How could I work around that? > I need paragraph style information extensoively and absolutely, I can't > simply remove the code using it.... Well I guess there are a few alternatives with varying implications. If there are not many NSMutableParagraphStyles and the code isn't very hot, I'd first consider a static global NSMapTable for pointers or GSIMap for scalars looked up by the objects address. But if you really need to keep the ivar local, then instead of adding the ivar in the header, I think you may have to hack the runtime-time structures to change instance size and ivar structures and worry about anyone that may have cached this information... And all this has to be done before the first instance is allocated. Then you need to probably use some a custom struct and pointer casting for accessing the ivar. It can get pretty hairy, but it's theoretically possible. Cheers, David _______________________________________________ Discuss-gnustep mailing list [email protected] http://lists.gnu.org/mailman/listinfo/discuss-gnustep
