Created
May 18, 2010 18:09
-
-
Save jorbsd/405313 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)description { | |
[self buildHeap]; | |
CFBinaryHeapRef tempHeap = CFBinaryHeapCreateCopy(NULL, 0, self.objs); | |
// This is technically not working now, there is a bug in CFBinaryHeap, the description is incorrect | |
// on Snow Leopard. | |
// FIXME: rdar://problem/7219189 | |
//return [NSString stringWithFormat:@"JBBPriorityQueue = %@", [NSMakeCollectable(CFCopyDescription(tempHeap)) autorelease]]; | |
NSMutableString *result = [NSMutableString stringWithFormat:@"<JBBPriorityQueue: %p> {", self]; | |
if (CFBinaryHeapGetCount(tempHeap) != 0) { | |
[result appendFormat:@"\n"]; | |
CFBinaryHeapApplyFunction(tempHeap, JBBBuildDescriptionCallBack, result); | |
} | |
[result appendFormat:@"}"]; | |
CFRelease(tempHeap); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment