You have to use the description
method inside your Person class
-(NSString *)description{
return @"FirstName: %@, LastName: %@, E-mail: %@",
_firstName, _lastName, _email;
}
This way you can print always the object you have inside your NSArray
but instead of the memory description you'll get returned the values you've defined before in your description method of the specific object.
If you just want to do this with the element from the NSArray
use placeholders:
NSLog(@"FirstName: %@, LastName: %@, E-mail: %@",
obj.firstname, obj.lastname, obj.email);
There is not much difference between, but its more useful because you don't have to rewrite it once you have created your description method, you just have to print the object.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…