iOS engineer who likes clean, simple designs and sans-serif.

Loading

Week 2 Day 3 – (NSString *) description method

NSObject implements a -(NSString *)description method, which makes debugging in console via NSLog really nice. A few seconds of code can make debugging much easier, especially when working with objects.

- (NSString *)description
{
    return [NSString stringWithFormat:@"%@, $%@", self.name, self.price];
}
lenli

About lenli

front end web developer @ga

  •  

Leave a Comment