有没有办法将NSString的内容用作NSArray指针名称?这是可能的,这是不可用,但也许有另一种方法是这样的:使用NSString内容作为NSArray名称
NSString*[email protected]"hi";
NSString*[email protected]"yo";
NSArray*testarray=[[NSArray alloc] initWithObjects:one, two, nil];
NSLog(@"actual count: %i", [testarray count]);
NSString*[email protected]"testarray";
NSLog(@"test count: %i",[ --insert here to get array name from testname-- count]);
我已经尝试了各种猜测什么,我可以在里面插入用我testname
作为数组名计数操作,但没有骰子。我知道这有点奇怪,但我可以预见很多有用的理由,我现在正在另一个应用中。
我认为这样做。我会试试看。 – johnbakers