我想在 for 循环中实例化一些自定义对象,从数组中检索它们。我还想给指针一个数组值的名称。(例子)
personArray in generalArray value: 0=name , 1=address, 2=mobile...</p>
对象:Person(带有 personArray 的即时变量)
////////
for (NSArray*person in generalArray){
NSString*name=[[NSString alloc] initWithString:[person ObjectAtIndex:0];
NSString*address=[[NSString alloc] initWithString:[person ObjectAtIndex:1];
…
//Now I want to instantiate objects "person" with "name, address…" variables. I also tried to name pointers with the "name" NSString.
}
有什么解决办法吗?