Does NSDictionary retain the objects (values) that are added?
Shouldn't "n" be 2 below?
You're making an assumption about the implementation of NSDictionary.
You're also either trying to learn about reference counting in
general, or trying to troubleshoot a memory management problem, by
looking at reference count at runtime. None of the above seems like a
good idea.
The important thing to keep in mind and focus on is the contract: You
need to balance your "reference count increasing" calls with your
"reference count decreasing" calls. That is your part of the contract.
Trust that the libraries and frameworks that you use does the right
thing, they typically have few memory management bugs as they get a
LOT of testing by virtue of being shared with so many developers and
end users.
If you're trying to find a memory leak, there are memory management
troubleshooting tools better suited for that purpose. A very good
place to start is using the "Leaks" template of Instruments.
j o a r
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/objc-language/email@hidden