aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPThreadAdditions.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPThreadAdditions.m')
-rw-r--r--Source/SPThreadAdditions.m14
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/SPThreadAdditions.m b/Source/SPThreadAdditions.m
index f61b6289..91a7a99d 100644
--- a/Source/SPThreadAdditions.m
+++ b/Source/SPThreadAdditions.m
@@ -95,3 +95,17 @@
}
@end
+
+#pragma mark -
+
+NSString * SPCtxt(NSString *description,NSObject<SPCountedObject> *object)
+{
+ NSString *idString = @"nil";
+ if(object) {
+ idString = [object className];
+ if([object respondsToSelector:@selector(instanceId)]) {
+ idString = [idString stringByAppendingFormat:@"#%lld", [object instanceId]];
+ }
+ }
+ return [NSString stringWithFormat:@"%@ (%@)",description,idString];
+}