• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [iPhone] CFAttributedStringRef autorelease - not possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iPhone] CFAttributedStringRef autorelease - not possible?


  • Subject: Re: [iPhone] CFAttributedStringRef autorelease - not possible?
  • From: Greg Guerin <email@hidden>
  • Date: Tue, 21 Jul 2009 10:33:41 -0700

Michael Hoy wrote:

I know it doesn't support NSAttributedString. However, CFAttributedStringRef is supported. (That's why I'm using it.) The documentation reads:

"iPhone OS Note: While Core Foundation on iPhone OS contains CFAttributedString, there are no additions to the APIs in UIKit to add specific attributes such as font, style, or color, and there are no APIs to draw attributed strings."

My question is about casting CFAttributedStringRef to id, which appears not to work in certain circumstances. For example, adding an (id)CFAttributedStringRef to an NSMutableArray appears to work fine... CFGetRetainCount() reports an increase and decrease in the retain count after adding/removing.

Wrap CFAttributedStringRef (or CFMutableAttributedStringRef) in a class of your own making. Then you can be sure it will autorelease correctly.


All it would need is a ref method/property that returns CFAttributedStringRef (or CFMutableAttributedStringRef), and a dealloc to call the appropriate CF function on the ref. This seems almost trivial to write, and would probably take less time than it took to create the example showing the failure.

  -- GG

_______________________________________________

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


  • Prev by Date: Re: The iPhone SDK "OpenGL ES Application" template
  • Next by Date: Re: [IB] - possible bug [was: how to delete action or outlet?]
  • Previous by thread: Re: [iPhone] CFAttributedStringRef autorelease - not possible?
  • Next by thread: fileManager:shouldMoveItemAtPath:toPath is never called
  • Index(es):
    • Date
    • Thread