| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
- (void) setTheory:(Theory *)newTheory {
if (theory == newTheory) return;
I would not do that for the reasons above. If you have reasons to believe
that theory==newTheory would occur often though, it might bring some -- in
my estimate *utterly* unimportant and invisible -- speedup.
...
[theory release];
theory = [newtheory copy/retain];
}
Alas, not only simple, but also incorrect in the case theory==newTheory &
&
[theory retainCount]==1. If so, the release would *dealloc* the object,
and thus the subsequent retain/copy sent to the same object would crash
(or, with a multithreaded app, do even worse things).
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.