Memory Questions
A few things have cropped while making sure my engine plays nice with memory resources:
1. Do automatic properties release old values before assigning the new ones?
2. Does the following code follow proper memory management?
3. If not, what is a good way to do the above?
1. Do automatic properties release old values before assigning the new ones?
2. Does the following code follow proper memory management?
Code:
Object* foo = [bar spawnNewObject];
[foo doSomething];
[bar release];
bar = nil;
[self setBar:foo];
[foo release];3. If not, what is a good way to do the above?
1.) read the docs, you can configure the behavior of properties via attributes.
2.) it's not entirely clear, it depends on what each of the methods called does.
3.) create a new hypothetical situation?
2.) it's not entirely clear, it depends on what each of the methods called does.
3.) create a new hypothetical situation?

