Re: retain variables between classes
Re: retain variables between classes
- Subject: Re: retain variables between classes
- From: Lawrence Meeran <email@hidden>
- Date: Wed, 17 Dec 2003 00:03:59 +0000
hi
it's ok i just figured this one out:
i'm less clear about the issue with the mutability of the array; in
this particular case (just setting an instance var) would it not make
sense to declare the argument as NSArray rather than NSMutableArray?
... obviously not if you needed the argument to be mutable because the
instance variable is mutable. (maybe other reasons too??)
but i've thought of another question relating to const declarations. In
Stroustrup's "The C++ programming language" he makes a bit of a fuss
about the importance of declaring arguments const if they are not
modified. This came up on the list briefly a few days ago and i got the
impression it was considered important in Obj-C also, by at least one
list member, but I haven't seen much general discussion of it, which
seems strange since many people here seem to be sticklers for careful
design of classes -- something i would like one day to also be a
stickler for.
i have plenty of methods that do not modify some/any of their arguments
- i am considering going in and changing all their declarations to
const before i go any further. I feel it may help the compiler to help
me not to screw things up. Am i right? Is there any disadvantage to
doing this?
L
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.