• 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
Properties and memory management
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Properties and memory management


  • Subject: Properties and memory management
  • From: Mike Manzano <email@hidden>
  • Date: Mon, 4 Aug 2008 20:51:20 -0700

Hi,

Sorry about this cross-post, but the obj-c language list seems sort of dead.

If I have a property:

@property( retain ) NSString *blah ;

and in my code I assign it:

myObj.blah = @"woot!" ;

and then I want to reassign it, do I have to release it?

[myObj.blah release] ;
myObj.blah = @"new woot!" ;

or does the new assignment automatically release the retain? How about for

@property( copy ) NSString *blah ;

Do I have to release the copy?

Thanks,

Mike
_______________________________________________

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: Properties and memory management
      • From: Jonathan Hess <email@hidden>
  • Prev by Date: Re: "backporting" nibs question / Rhapsody license anyone?
  • Next by Date: Re: Properties and memory management
  • Previous by thread: Re: guidelines/tutorial for implementing custom controls
  • Next by thread: Re: Properties and memory management
  • Index(es):
    • Date
    • Thread