Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to write proper description method to a class?

Tags:

How to write proper description method to a class?

I have implemented

- (NSString *)description {      NSString *descriptionString = [NSString stringWithFormat:@"Name: %@ \n Address: %@ \n", self.name, self.address];      return descriptionString;  } 

Evrey thing is fine if I call description on my object. But if I have an array of objects and I call description on it I get:

"Name: Alex \n Address: some address \n",

What I would like to get is

"Name: Alex

Address: some address"