ios - What is the syntax for using the color property of a class in an "if...then" statement -


i have program in depending on touch screen, make square turn red or blue. based on color square is, want have specific set of rules. i'm trying write code states if square color red...do this, or if square color blue... that. square in its' own class , i'm using setter/getter method named setcolor in order change it's color viewcontroller class. when writing "if then" rule, can't write "if (cv.color == bluecolor) {do something...}". know proper syntax in situation?

you can compare colors:

if ([cv.color isequal:[uicolor bluecolor]]) {     // it's blue } else if ([cv.color isequal:[uicolor redcolor]]) {     // it's red } 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -