memory management
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.