For the last few hours, I have been trying to do something that makes perfect sense to me but not to Xcode, and I still haven't figured out a way to do it. So here it goes.
NSArray *array = [MedInfo getCategoryFirstIndexArray];
Here, getCategoryFirstIndexArray is just a class method of MedInfo:
@interface MedInfo : NSObject
+(NSArray *)getCategoryFirstIndexArray;
@end
But Xcode is keep telling me there is an error in the code, saying 'Expected expression'??
Funny thing is, if I put [MedInfo getCategoryFirstIndexArray]; only, the compiler says it's fine, but as soon as I'm trying to assign the return value to another variable, there is an error.
So what am I doing wrong here? Am I asking too much?
EDIT: Ok, this is dumb. I have been trying to make a new variable inside a switch statement, something like this:
switch(self.viewType.integerValue)
{
case 0:
break;
default:
NSArray *array = [MedInfo getCategoryFirstIndexArray];
break;
}
And apparently I didn't know that objective-C doesn't support that (another reason to hate this horrendous language). Sorry for my ignorance, and thank you whoever you are for trying to help! Good bye!