stringWithFormat:


#1

Hi guys,
Not quite getting the example in our BNREmployee class.

[code]- (NSString *)description

{
return [NSString stringWithFormat:@"<Employee %d>", self.employeeID];
}
[/code]

Why is Employee in angle brackets?

I know that %d returns an integer and have tried out this code in Xcode where it outputs ‘Employee 12’, but I’m just not sure what is going on with the angle brackets. I didn’t see them mentioned in the book or in apple documentation for this class.


#2

They (angle brackets) have no special significance inside the format string, they are simply being used to decorate the output.


#3

Awesome, thank you.