subclassing NSBitmapImageRep
subclassing NSBitmapImageRep
- Subject: subclassing NSBitmapImageRep
- From: Patrick Tepesch <email@hidden>
- Date: Wed, 20 Feb 2002 00:00:34 -0500
I am trying to create a subclass of NSBitmapImageRep to handle reading
16-bit tiff files. To test this, I have overridden the following
methods, and all the methods for creating reps:
+ (NSArray *)imageUnfilteredFileTypes {
static NSArray *types = nil;
printf("MyBitmapImageRep imageUnfilteredFileTypes!!!!\n");
if (!types) types = [[NSArray alloc]
initWithObjects:@"TIF", nil];
return types;
}
+(void)load
{
printf("MyBitmapImageRep load!!!!\n");
[NSImageRep registerImageRepClass:[MyBitmapImageRep class]];
}
Both printf statements execute in my code, and my code is called if I
give it a new type rather than a type already handled by
NSBitmapImageRep. But when the a .TIF image is loaded from NSImage it
still calls NSBitmapImageRep methods, rather than the methods in my
subclass, thus the load continues to fail.
Any suggestions on how to get my subclass methods called before the
NSBitmapImageRep methods?
Thanks,
Patrick Tepesch
_______________________________________________
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.