• 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: @property and Garbage Collection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: @property and Garbage Collection


  • Subject: Re: @property and Garbage Collection
  • From: Kevin Bracey <email@hidden>
  • Date: Tue, 25 Jan 2011 23:15:29 +1300

Yes, I can see the the rule for copy, I'm guessing it still makes a copy.

I'm a little confused as to what ( retain ) now does, does it now also do a copy, If I remove the ( copy ) I get
warning: default 'assign' attribute on property 'allImportHeaders' which implements 'NSCopying' protocol not appropriate with -fobjc-gc-only

so I'm unsure should I use the retain or copy keyword for the objects that conform to the 'NSCopying' protocol?

Also I was retaining IBOutlets before CG but I'm unsure what to do with them as they don't mind being assigned.

Thanks
Kevin

On 25/01/2011, at 11:03 PM, Thomas Davie wrote:

>
> On 25 Jan 2011, at 09:59, Kevin Bracey wrote:
>
>> Hi Guys,
>>
>> I've been using Retain/Release up til now but I have started my first GC project.
>>
>> In a Garbage Collected App when using the @property is it correct that I still have to specify (copy) or (retain) or have I missed something? I thought using GC didn't require retain and that everything could just be assigned, but the complier complains.
>
> There is still a semantic difference between simply keeping hold of a reference to something, and copying that something, even if you have a neat tool keeping track of whether you still hold a reference.
>
> Bob

_______________________________________________

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

  • Follow-Ups:
    • Re: @property and Garbage Collection
      • From: Greg Parker <email@hidden>
    • Re: @property and Garbage Collection
      • From: Quincey Morris <email@hidden>
References: 
 >@property and Garbage Collection (From: Kevin Bracey <email@hidden>)
 >Re: @property and Garbage Collection (From: Thomas Davie <email@hidden>)

  • Prev by Date: Re: [iPhone] can't get views not to slide off by the height of the status bar
  • Next by Date: Re: lots of find/replace in text file
  • Previous by thread: Re: @property and Garbage Collection
  • Next by thread: Re: @property and Garbage Collection
  • Index(es):
    • Date
    • Thread