What is the Objective-C equivalent for “toString()”, for use with NSLog?

It is the description instance method, declared as:

- (NSString *)description

Here’s an example implementation (thanks to grahamparks):

- (NSString *)description {
   return [NSString stringWithFormat: @"Photo: Name=%@ Author=%@", name, author];
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)