Am 20.02.2011 um 17:49 schrieb Jeric Batarina:

> Is it possible to use NSString as the variable to create an NSMutableArray?
> 
> My thoughts is that it'd go like this:
> 
> NSMutableArray [NSString stringWithCString: <variableName>] =
> [NSMutableArray new];
> 
> Any ideas if this'd work?

a) No, because variable names are analyzed by the compilers at compile time (it 
is not an interpreter)
b) What do you need it for? If you think you need it you have some fundamental 
flaw in your application architecture.
c) you can dynamically access instance variables (with fixed name) through KVC. 
This uses a NSString as the path.
    It works because the compiler stores a table of all instance variable names 
in the executable code.

-- hns


_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to