Newbie, regarding retain count and program flow
Newbie, regarding retain count and program flow
- Subject: Newbie, regarding retain count and program flow
- From: Jesse Abram <email@hidden>
- Date: Mon, 22 Nov 2004 16:58:14 -0800
Hi, I'm still working on my first big Cocoa app (big meaning I plan to
release it when it is done), and I've run into memory management
problems (which I am going to study up on and solve on my own), but in
debugging, I've come upon something that I don't understand, and it
could be due to something I don't know about Object Oriented program
flow. I'll start by outlining the situation:
I have an awakeFromNib method, which I use to initialize variables that
make up the world of the game I'm making. At the very end of the
method, I do a series of NSLog()s to determine the retain count of each
of the 7 rooms that I've created at this point (rooms are represented
as custom objects).
The program begins what is largely procedural operation when the user
types some text into an NSTextField and hits return. Other than a quit
button, this is the only user means of communicating with the program.
So, from this, I assume that the method that this entering of text
invokes, named writeOut:, is the next code that the program goes
through, awakeFromNib -> writeOut:.
However, when I check the retain counts of the same 7 objects at the
very beginning of this method, one of them has a retain count that is 1
higher than it was right at the end of the previous method. Let me know
if my description of all of this is too vague, I can go into as much
detail as I need to, or please let me know if any fundamental flaw of
my understanding of either of the 2 concepts mentioned jumps out at
you.
Thank you very much in advance,
Jesse
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden