• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Subclassing NSImageRep
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: NSMatrix & mouseDragged?
  • Next by Date: Preference Window Question
  • Previous by thread: Re: gdb objc_msgSend: trace messages
  • Next by thread: Preference Window Question
  • Index(es):
    • Date
    • Thread