Subclassing NSImageRep
Subclassing NSImageRep
- Subject: Subclassing NSImageRep
- From: Sebastian Gomez Papiol <email@hidden>
- Date: Sun, 30 Mar 2003 05:47:57 +0200
I followed the instructions of the apple documentation, first I
register my class, then I do my own imageUnfilteredFileTypes and
canInitWithData methods. With this I have my own NSImageRep class
registered and I specify exactly what type of data I can read with it.
+ (void)load
{
[NSImageRep registerImageRepClass:[self class]];
}
+ (NSArray *)imageUnfilteredFileTypes
{
return [[NSArray alloc] initWithObjects:@"my_file_type", nil];
}
The last step is write the initWithData method... but debugging the
code I noticed my initWithData method is never called. Then I write
this canInitWithData method:
+ (BOOL)canInitWithData:(NSData *)data
{
return YES;
}
And of course I try to read a file format not supported with any other
class... but my initWithData method is not called. What is wrong in my
code? Wich is the correct procedure to subclassing NSImageRep? thanks
_______________________________________________
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.