• 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
Re: NSBitmapImageRep subclass problem (SOLVED)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBitmapImageRep subclass problem (SOLVED)


  • Subject: Re: NSBitmapImageRep subclass problem (SOLVED)
  • From: Alan Hart <email@hidden>
  • Date: Sat, 8 Apr 2006 10:31:56 +0100


On 8 Apr 2006, at 03:46, John C. Randolph wrote:


On Apr 7, 2006, at 12:06 PM, Nicko van Someren wrote:

On 7 Apr 2006, at 19:03, Alan Hart wrote:
However, I'd really prefer to do it using a PCXImageRep class, defined and registered as a subclass of NSBitMapImageRep, since it seems that's the way the Cocoa image architecture ought to work. Then it would be available to read a .pcx file anywhere in my app, and it would be more reusable elsewhere.

So I have:
...
- (BOOL) canInitWithData {
	return YES;
}

Shouldn't that be a class method not an instance method?

That's one of the two mistakes here. +canInitWithData: takes a parameter: an NSData object, which the method will examine to see whether it can decode its contents.


Thank you everyone! Randolf and Heinrich both spotted my two errors. That fixed it. Lesson learned. I'll be far more careful about checking my method signatures in future.

Interestingly, even though that method is now correctly specified it is never called in my app. I assume there's an introspection call in NSImageRep that has to succeed.

Isn't this place great? And you're all so patient with idiots :-)

Alan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSBitmapImageRep subclass problem (From: Alan Hart <email@hidden>)
 >Re: NSBitmapImageRep subclass problem (From: Nicko van Someren <email@hidden>)
 >Re: NSBitmapImageRep subclass problem (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: Getting NSData out of an NSImage
  • Next by Date: Re: Getting NSData out of an NSImage
  • Previous by thread: Re: NSBitmapImageRep subclass problem
  • Next by thread: Re: NSBitmapImageRep subclass problem
  • Index(es):
    • Date
    • Thread