• 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
Small question pertaining to memory management
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Small question pertaining to memory management


  • Subject: Small question pertaining to memory management
  • From: Michael de Haan <email@hidden>
  • Date: Sun, 24 Jan 2010 06:57:52 -0800

No...it's not a question about "the rules"!  I know better than to ask that!  :-)

On page 271 in Hillegass, (Typing tutor) a setter is defined thus:



-(void) setString:(NSString *) c
{
    c = [c copy];
    [string release];
    string = c;

}

and "string" is subsequently released in the "dealloc" method.

The caller is  the overridden method:


-(void) insertText:(NSString *)input
{
    [self setString:input];
}



My question pertains the **original** object , which was referenced/passed to the method "setString".


Can I **assume** that the originally referenced object   is released in an appropriate way, once the copy is created and assigned to "c"?
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Small question pertaining to memory management
      • From: Clark Cox <email@hidden>
    • Re: Small question pertaining to memory management
      • From: Sherm Pendley <email@hidden>
    • Re: Small question pertaining to memory management
      • From: Mark Suman <email@hidden>
  • Prev by Date: Re: gdb: Newbie can't use 'print -[object message]'
  • Next by Date: Re: Small question pertaining to memory management
  • Previous by thread: Re: gdb: Newbie can't use 'print -[object message]'
  • Next by thread: Re: Small question pertaining to memory management
  • Index(es):
    • Date
    • Thread