Here is another example:
NSString *test = [[NSString alloc] initWithFormat:@"%u:%u:%u.000", hours, minutes, seconds]; NSSize boundingSize = {100,300};
Here is for stringAttributes, which can help noobs like me:
NSMutableDictionary *stringAttributes; stringAttributes = [NSMutableDictionary dictionary]; [stringAttributes setObject:[NSFont fontWithName:@"Monaco" size:16] forKey:NSFontAttributeName]; [stringAttributes setObject:[NSColor whiteColor] forKey:NSForegroundColorAttributeName]; [stringAttributes setObject:[NSColor blackColor] forKey:NSBackgroundColorAttributeName];
source share