Well, according to my Obj-C book, there are 3 different ways to write an accessor method to set a variables value.
One is "Retain, then release", another is "Check before change", and the last is "Autorelease old value".
Retain then release adds a retain and release command, which is supposedly bad. Check before change adds an extra if statement. Autrelease old value can cause an application crash, so its definitely off for me.
My question is how CPU intensive is it for if-else statements and retain/release?
Eg, which is going to make the biggest impact when I have a lot of accessors being used?
One is "Retain, then release", another is "Check before change", and the last is "Autorelease old value".
Retain then release adds a retain and release command, which is supposedly bad. Check before change adds an extra if statement. Autrelease old value can cause an application crash, so its definitely off for me.
My question is how CPU intensive is it for if-else statements and retain/release?
Eg, which is going to make the biggest impact when I have a lot of accessors being used?