Re: Still no way to view CFString in custom data fomatter, huh?
Re: Still no way to view CFString in custom data fomatter, huh?
- Subject: Re: Still no way to view CFString in custom data fomatter, huh?
- From: Rick Mann <email@hidden>
- Date: Wed, 31 Oct 2007 22:35:45 -0700
On Oct 31, 2007, at 9:53 PM, Chris Espinosa wrote:
I think you're misinterpreting that sentence. It means you can't
write a custom data formatter to display CFStringRefs differently
than the standard CFStringRef formatter. It doesn't mean that it
can't display strings. (Even we would consider that lame.)
The notable thing about data formatters, standard or custom, is that
they're keyed off of the declared type of the variable or data
member, not the type of what you assign to it. So if mObject is an
NString, and there's no standard data formatter for NString, then
you need to create a custom data formatter for it.
It's easy enough to do so; if you can assure that an NString is
always a CFStringRef, then you just cast it. In the Summary, type:
{(CFStringRef)$VAR}:s
Here's what I see: http://roderickmann.org/stuff/outofscope.jsp
I tried using
{(CFStringRef)$VAR.mObject.mName}:s
for mName, to no avail. I tried a few variants here. %NCFObject.mObject
% returns the value field, which is just the hex address. Nothing else
returned anything.
One bug: If I type in mName's summary, "%NCFObject.mName%" and press
return, the edit field contents are replaced with the value
(0x645b80), but the edit field remains open. If I edit that, I end up
with the address as a literal, and I lose the %-stuff I had typed
before. Pressing return in that state should probably accept the data
formatter and close edit.
--
Rick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden