Re: CFAttributedStringGetMutableString returning null value
Re: CFAttributedStringGetMutableString returning null value
- Subject: Re: CFAttributedStringGetMutableString returning null value
- From: Ali Ozer <email@hidden>
- Date: Wed, 17 Jun 2009 10:38:00 -0700
This function has not been implemented for the pure-CoreFoundation
case. This is mentioned in the header comments:
> (Note: This function is not yet implemented and will return NULL
except for toll-free bridged instances.)
But it is not in the docs; should be.
As the comment implies, you can make this work by you calling -
mutableString on the CFMutableAttributedString:
CFMutableStringRef str = (CFStringRef) [(id)a mutableString];
Or you can access the string immutably through
CFAttributedStringGetString(), or mutate the attributed string through
CFAttributedStringReplaceString().
Ali
Begin forwarded message:
From: Travis Kirton <email@hidden>
Date: June 15, 2009 8:29:57 PM PDT
To: email@hidden
Subject: CFAttributedStringGetMutableString returning null value
I have a method, where I need to append to a MutableAttributedString
Here is the method...
- (void)appendStringFromSelf:(CFMutableAttributedStringRef)theString
with:(
CFIndex)numberOfGlyphs
{
CFMutableStringRef mutableString = CFAttributedStringGetMutableString
(theString);
CFAttributedStringRef appendableString =
CFAttributedStringCreateWithSubstring(...);
CFStringAppend(mutableString,CFAttributedStringGetString
(appendableString));
return;
}
What is strange is that the first line in this method:
CFMutableStringRef mutableString = CFAttributedStringGetMutableString
(theString);
mutableString is NULL even though variable-> theString is a non-null
MutableAttributedString
Does anyone know why this might be happening?
Cheers,
Travis
_______________________________________________
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