On Apr 12, 2006, at 4:19 PM, Allan Odgaard wrote:
On 12/4/2006, at 23:37, Mark Grimes wrote:
[...] Clearly fThing is not defined so return fThing makes no sense in a getter accessor method. Nor does instantiating another string object in the setter method.
As for fThing, I have no idea. I guess f is a prefix to signal “instance variable.” I don’t see anything new instantiated in the setter though. It makes a copy of the ivar pointer, copies the new value to the ivar, and the releases the old ivar via the copied pointer.
This brings to question other accessor snippets. Take scalars for instance:
- (${1:unsigned int})${2:thing} { return ${3:fThing}; }
- (void)set${2/./\u$0/}:(${1:unsigned int})new${2/./\u$0/} { ${3:fThing} = new${2/./\u$0/}; }
Clearly this fThing is a problem... a simple insert and recompile generates errors and warnings. Does anyone on the list know why this is there, and if it is a shortcut to some prefix voodoo, why doesn't it just work as-is? I'm inclined to want to change this as well.
(On a side note: Mmmmmm CoreData accessor... woot bbum!)
-- Mark Grimes Stateful Labs mark@stateful.net