Using a String representing the name of a variable to set the variable
问题 This is a basic example that I know can be simplified, but for testing sake, I would like to do this in such a way. I want to set a variable based on an appending string (the variables "cam0" and "pos1" are already declared in the class). The appending string would essentially be an index, and i would iterate through a loop to assign cameras (cam0, cam1..) to different positions (pos0, pos1..). cam0 is defined as an UIImageView pos1 is defined as a CGRect This works for a NSString Variable