Any way to print in color with NSLog?

You can use Apple Color Emoji to add some color to your Log output like this:

if ([self isKindOfClass:[UITableViewController class]])
    NSLog(@"💙 Table View controller Will appear: %@", NSStringFromClass([self class]));
else  if ([self isKindOfClass:[UINavigationController class]])
    NSLog(@"💜 Navigation controller Will appear: %@", NSStringFromClass([self class]));
else
    NSLog(@"💛 View controller Will appear: %@", NSStringFromClass([self class]));

Because the above code might by displayed incorrectly on non-OS-X-platforms, I attached a screenshot of XCode, showing the code and log output:

Screenshot from X Code with Apple Color Emoji in code and log output

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)