Re: Adding Categories to NSMutableData
Re: Adding Categories to NSMutableData
- Subject: Re: Adding Categories to NSMutableData
- From: Ken Thomases <email@hidden>
- Date: Thu, 29 May 2008 13:27:07 -0500
On May 29, 2008, at 12:59 PM, Robert Kukuchka wrote:
I'm trying to add a simple category to NSMutableData, but when I
try to call my method I'm getting "*** -[NSConcreteData
remainderDataWithParseByte:]: unrecognized selector sent to instance
0x816400". I've added categories to NSString and NSArray before,
which have similar abstract interfaces to concrete classes. Is there
some trick I'm missing?
Have you verified that the object really isKindOfClass:[NSMutableData
class] ?
Using class-dump on the Foundation framework shows me that
NSConcreteData subclasses NSData, while NSConcreteMutableData is a
subclass of NSMutableData.
Given the nature of class clusters and the private concrete classes
within them, I suppose it's possible that you did everything right
(asked for an NSMutableData) but were given an NSConcreteData instead,
and that it does the right thing in almost all cases. I'd still
consider it a bug in the framework if a category on NSMutableData
didn't work on it, if that's the case.
Cheers,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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