objective-c description method
- by rocity
Maybe I'm stupid...and this is my first question so forgive me...but when I run this code, I get the following output:
(FROG idle:0 animating:0 rect:(null) position:{{1,2}{3,4}} tongue:{5,6})
This is wrong because it seems to be skipping the rect format string and placing everything displaced by one. So idle and animating are what i expect, then rect is skipped, but the result from NSStringFromCGRect(self.rect) is placed into position, then the result for position is pushed to tongue, then tongue is not displayed at all.
I'm at a loss.
- (NSString *)description{
return [NSString stringWithFormat:@"(FROG idle:%i animating:%i rect:%@ position:%@ tongue:%@)",
self.idleTime,
self.animating,
NSStringFromCGRect(self.rect),
NSStringFromCGPoint(self.position),
tongue
];
}