I've got the following little code conundrum..
- (void) transmitArray {
NSString* arrayName = @"array1";
NSArray* array1 = [NSArray arrayWithObject:@"This is Array 1"];
NSArray* array2 = [NSArray arrayWithObject:@"This is Array 2"];
NSMutableArray* targetArray = [NSMutableArray arrayWithCapacity:1];
}
Is there a way to use the string "array1" to access the NSArray 'array1' so I can copy it into the target array.. And therefore, if the string read "array2", I'd be able to access the second array?
I read about using NSSelectorFromString to create a selector, and that this technique was called 'introspection', but other than that I'm stumped..
Hope someone can help!