Générer un UIColor aléatoire

J'essaye d'obtenir des couleurs aléatoires pour UILabel...

- (UIColor *)randomColor
{
    int red = arc4random() % 255 / 255.0;
    int green = arc4random() % 255 / 255.0;
    int blue = arc4random() % 255 / 255.0;
    UIColor *color = [UIColor colorWithRed:red green:green blue:blue alpha:1.0];
    NSLog(@"%@", color);
    return color;
}

Et de l'utiliser:

[mat addAttributes:@{NSForegroundColorAttributeName : [self randomColor]} range:range];

Mais la couleur est toujours noir. Quel est le problème?

P. S. Désolé pour mon anglais )

source d'informationauteur Tatiana Mudryak