Hi, I am using Cocoa with XCode for Objective-C project.
I am using "Switch" statement for strings which is giving compile error. But "Switch" is working fine in windows for strings......For example the following code for Objective-C is giving errrors:
Can anyone tell me why it is not working.
Ofcourse, the solution for this is to use "if-else", but how to get it done using switch.
I am using "Switch" statement for strings which is giving compile error. But "Switch" is working fine in windows for strings......For example the following code for Objective-C is giving errrors:
Code:
switch(name)
{
case @"Apple":
.......
break;
case @"Grapes":
.......
break;
default:
break;
}
Can anyone tell me why it is not working.
Ofcourse, the solution for this is to use "if-else", but how to get it done using switch.