Initializing Subclass of NSTextContainer
Initializing Subclass of NSTextContainer
- Subject: Initializing Subclass of NSTextContainer
- From: Gordon Apple <email@hidden>
- Date: Mon, 29 Jan 2007 16:53:38 -0600
I have experimented with subclasses of NSTextContainer several times
with no problem. However, the following is even blocking the opening of my
(subclassed) NSTextView window.
#import <Cocoa/Cocoa.h>
@class EDDynamicArray;
@interface PolyTextContainer : NSTextContainer
{
NSBezierPath* path; // Original test case.
NSBezierPath* poly; // Flattened Bezier
NSRect r; // Progressively trimmed version of proposed rect
EDDynamicArray* pa; // point array
EDDynamicArray* xa; // exclude array
float prTop; // Top of proposed rect.
float prBot; // Bottom of proposed rect.
}
-(void)setPoly:(NSBezierPath*)path;
-(NSBezierPath*)poly;
@end
in Implementation:
-(void)init
{
[super init];
int spa = sizeof(NSPoint);
int sxa = sizeof(EDExcludeRange);
pa = [[EDDynamicArray alloc] initWithSizeOfElement:spa];
xa = [[EDDynamicArray alloc] initWithSizeOfElement:sxa];
}
EDDynamicArray was originally a subclass of NSMutableData, but I then
changed it to subclass NSObject and to contain an NSMutableData object,
which didn't help. In the subview of NSTextView in AwakeFromNib, I replace
the text container. (This has worked before.)
In this case, when run, the [EDDynamicArray alloc] appears to generate a
log message saying:
2007-01-29 16:41:29.676 DocBooker[12196] *** -[EDDynamicArray textView]:
selector not recognized [self = 0x37a570]
That sounds like a call is not matching up with what I am trying to
call. How could "alloc" be going wrong? What else could be happening?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden