Undocumented Foundation selector not recognized?
Undocumented Foundation selector not recognized?
- Subject: Undocumented Foundation selector not recognized?
- From: Tom Harrington <email@hidden>
- Date: Mon, 31 Jan 2005 13:16:55 -0700
A user sent me the following error from their system (or console?) log:
*** -[NSCFData _fastCharacterContents]: selector not recognized
I'm having a hard time pinning this down, because
_fastCharacterContents is not a documented part of Foundation, is not
one of my own methods, and does not appear anywhere in my code.
Some Googling indicates that the method is probably an undocumented
part of NSString. In Darwin code it's called from
CFStringGetCharactersPtr(), which is part of CFString(). (Found this
out at <http://gobsd.com/code/darwin/CoreFoundation/String.subproj/CFString.c>).
So it would seem this is a case of mistakenly storing an NSData in a
pointer to NSString, but how can I get this error message if I'm not
calling the method in question?
My theory is that this must come from calling some public method that
exists on both NSData and on NSString, and calling it on the NSData
stored as pointer-to-NSString. As I understand it, the ObjC runtime
would call the NSString version of the method, which in turn might
call undocumented internal NSString methods on the NSData.
Does that theory seem to make sense? Are there any other likely
causes of this error?
--
Tom Harrington
email@hidden
_______________________________________________
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