我有一个自定义对象,我创建与它定义的3个属性.我创建对象并将值分配给这些属性.之后,我将该对象放入一个NSMutable数组.我知道我可以使用:
for (id obj in personArray) { NSLog(@"obj: %@",obj); } NSLog(@"%@",personArray);
告诉我我的阵列中有什么样的对象?但是我想要更深一层,我希望能够看到每个对象的属性是什么.我只是不知道如何瞄准他们.@H_403_5@
这是代码,我正在使用:
人是我的自定义对象.@H_403_5@
personObject = [[Person alloc]init]; [personObject setFirstName:firstName.text]; [personObject setLastName:lastName.text]; [personObject setEmail:emailAddress.text]; // add the person object to the array // the array was alloc and init in a method above this code. [personArray addObject:personObject]; for (id obj in personArray) { NSLog(@"obj: %@",obj); } NSLog(@"%@",personArray);