• 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: when __bridge isn't required
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: when __bridge isn't required


  • Subject: Re: when __bridge isn't required
  • From: Charles Srstka <email@hidden>
  • Date: Sun, 28 Jul 2013 02:13:20 -0500

On Jul 27, 2013, at 2:05 PM, Zac Bowling <email@hidden> wrote:

> The first one is a NSConstantString string. It's not like a malloc'd NSString. It's effectively a singleton. It doesn't mater how it's bridged because it can't be released. The second is a new NSURL that is allocated on the heap. It needs to be released so it needs to be bridged correctly to handle things properly.


CFStringGetIntValue() is passed an NSString * variable (casted to a CFStringRef). The fact that a constant string was assigned to it earlier is neither here nor there. As far as that function knows, that variable could contain an NSConstantString, an NSMutableString, an NSCFString, an NSPathStore2, or any other subclass of NSString.

For the record, I tried his example, assigning an NSMutableString to the "answer" variable and got the same result.

On Jul 27, 2013, at 2:16 PM, Matt Neuburg <email@hidden> wrote:

> Argh. Okay, I'll ask this on devforums when it comes back up, in case it depends on, uh, the thing I'm using that I can't talk about. m.

I seem to be able to reproduce it in 4.6.3, so it's not solely dependent on The IDE Who Must Not Be Named.

Charles

_______________________________________________

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


References: 
 >when __bridge isn't required (From: Matt Neuburg <email@hidden>)
 >Re: when __bridge isn't required (From: Robert Martin <email@hidden>)
 >Re: when __bridge isn't required (From: Quincey Morris <email@hidden>)
 >Re: when __bridge isn't required (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: Observing Time
  • Next by Date: Re: UIScrollView to UIImage
  • Previous by thread: Re: when __bridge isn't required
  • Next by thread: Re: when __bridge isn't required
  • Index(es):
    • Date
    • Thread