• 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: C struct and __unsafe_unretained
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C struct and __unsafe_unretained


  • Subject: Re: C struct and __unsafe_unretained
  • From: Thomas Davie <email@hidden>
  • Date: Sun, 30 Oct 2011 18:44:20 +0000

Yes and no – it means you have an NSString there that can disappear at any moment without warning, and when it does, you'll still have a pointer into garbage memory.  Also, if the original code has been copying/retaining it into the struct and releasing it out, then it's entirely possible that by doing this you very much *are* changing something.

Personally I would take this as a prompt to move to using a class and a (copy) property.

Bob
if (*ra4 != 0xffc78948) { return false; }

On 30 Oct 2011, at 18:40, James Merkel wrote:

> Ok thanks.  Not changing anything is the easiest and safest approach.
>
> Jim Merkel
>
> On Oct 30, 2011, at 10:52 AM, Dave Zarzycki wrote:

_______________________________________________

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: 
 >C struct and __unsafe_unretained (From: James Merkel <email@hidden>)
 >Re: C struct and __unsafe_unretained (From: Dave Zarzycki <email@hidden>)
 >Re: C struct and __unsafe_unretained (From: James Merkel <email@hidden>)

  • Prev by Date: Re: C struct and __unsafe_unretained
  • Next by Date: Re: Versions and project editor app
  • Previous by thread: Re: C struct and __unsafe_unretained
  • Next by thread: How to draw over a control in an NSView
  • Index(es):
    • Date
    • Thread