我喜欢我的看起来不错:有时 Xcode 会删除换行符,有时则不会,所以 YMMV:
- (NSString *)description // also used for comparison purposes
{
NSMutableString *str = [NSMutableString stringWithCapacity:256];
#ifndef NDEBUG // so in Distribution build, this does not get included
[str appendFormat:@"Address ID=\"%@\"\n", [self.privateDict objectForKey:kID]];
[str appendFormat:@" usrID: %@\n", [self.privateDict objectForKey:kADuserID]];
[str appendFormat:@" first: %@\n", [self.privateDict objectForKey:kADfirstName]];
[str appendFormat:@" last: %@\n", [self.privateDict objectForKey:kADlastName]];
[str appendFormat:@" address: %@\n", [self.privateDict objectForKey:kADaddress]];
[str appendFormat:@" suite: %@\n", [self.privateDict objectForKey:kADsuiteApt]];
[str appendFormat:@" city: %@\n", [self.privateDict objectForKey:kADcity]];
[str appendFormat:@" state: %@\n", [self.privateDict objectForKey:kADstate]];
[str appendFormat:@" zip: %@\n", [self.privateDict objectForKey:kADzipCode]];
[str appendFormat:@" phone: %@\n", [self.privateDict objectForKey:kADphone]];
#endif
return str;
}