Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Undocumented Foundation selector not recognized?



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.