playerOneScore is a int, How can I pass it to use a label to display the score? This code just prints %i…
-(void)updateScoreLabels{
playerOneScoreLabel.text = @"%i",playerOneScore;
playerTwoScoreLabel.text = @"%i",playerTwoScore;
playerThreeScoreLabel.text = @"%i",playerThreeScore;
playerFourScoreLabel.text = @"%i",playerFourScore;
}
You need to initialize string using convenience constructor:
What you actually have in your code is comma operator – it evaluates its 1st parameter (that is assigns @”%i” string to a label), then evaluates and returns 2nd parameter – playerOneScore.