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

memory management


  • Subject: memory management
  • From: Uwe Schlosser <email@hidden>
  • Date: Mon, 14 Apr 2003 20:27:13 +0200

I use the following code segment in a document based cocoa application:

feldname1= [NSString
stringWithFormat:NSLocalizedString(@"Field1",nil)]; // NSString
*feldname1;
[boxArray insertObject:feldname1 atIndex:1]; // NSMutableArray
*boxArray;

after this line the "retaincount" of feldname1 is two (including the
autorelease of the first line)

I know that I am responsible for the memory management of feldname1 for
these lines

now I set three text fields in the user interface created with
Interface Builder:
[Feldname1Doc setStringValue:feldname1]; // IBOutlet NSTextField
*Feldname1Doc;
[Feldname1Add setStringValue:feldname1]; // IBOutlet NSTextField
*Feldname1Add;
[Feldname1Pref setStringValue:feldname1]; // IBOutlet NSTextField
*Feldname1Pref;

after this the "retaincount" of feldname1 is 5


now my question: when the document is closed, who is responsible of
decreasing the retaincount of feldname1 for the last three lines ? Is
this done automatically or must this done in the dealloc subroutine?

Thanks for any Help

Uwe
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • RE: memory management
      • From: "Jonathan E. Jackel" <email@hidden>
  • Prev by Date: Re: irrelevant ADB trivia
  • Next by Date: NSMenu to show on when press button on Normal Click
  • Previous by thread: Re: Move Camera in OpenGL ? (David Remahl)
  • Next by thread: RE: memory management
  • Index(es):
    • Date
    • Thread