in iOS, Programming, Uncategorized

CS139P Red and Black Playing Card Suits

I am currently going through Stanford’s CS139P iPhone Application Development Course for iOS 7. I came upon the problem of having my suits only showing black for diamonds, spades, hearts, and clubs.

I started to look at other repos on GitHub of the same project, and I saw I had the same exact thing as the working solution. I then tried to copy validSuits class method in PlayingCard.m directly into my own project, and that fixed it. The problem might have been with choosing the wrong special character from the special character panel. After some looking around in the various tabs, I found the correctly colored suits and I was able apply them again.

+ (NSArray *) validSuits
{
    return @[@"♦️", @"♠️", @"♣️", @"♥️"];
}

You can copy the above class method into the PlayingCard.m to have red and black Playing Card suits.

I tried searching online, but there were no solutions to this problem. Hopefully the search engines indexes this page for others running into the same problem.