How I must remove objects?
For example, I have NSDictionary and some NSStrings from it:
NSDictionary *dict = [NSDictionary dictionaryWithObjects....];
NSString *str = [dict objectForKey:@"key"];
[str release]; or [str dealloc]; or str = nil or it’s autorelease object?
If I will remove not autorelease dict, will all child removed too?
Memory management in objective c is based on object ownership. If you own the object you must release that object.
Cocoa sets the following policy:
This is just corollary of the previous policy rules, stated explicitly.
In your case
you are not owner of str, so you should not release that object.