Hello,
I'm trying to declare an instance in a switch... but it doesn't work! I get an error.
Does anyone know why? and is there any alternative to do that (I tried to do with if else but same problem)? I want to save memory it's why I don't want to declare all of them (I have 9 instances).
Thanks
I'm trying to declare an instance in a switch... but it doesn't work! I get an error.
Code:
switch ([sender tag]) {
case 1:
StoryView *sub = [[StoryView alloc] init];
break;
case 2:
ImageView *subMenu = [[ImageView alloc] init];
}
Does anyone know why? and is there any alternative to do that (I tried to do with if else but same problem)? I want to save memory it's why I don't want to declare all of them (I have 9 instances).
Thanks