I have a int
variable called pageIndicator
.
I would like to include it inside another variable so it will save me some lines of code.
This is what I have:
Products *productPage0 = [productArray objectAtIndex:0];
Products *productPage1 = [productArray objectAtIndex:1];
Products *productPage2 = [productArray objectAtIndex:2];
Products *productPage3 = [productArray objectAtIndex:3];
And this is what I want:
Products *productPage(@"%d", pageIndicator) = [productArray objectAtIndex:pageIndicator];
Is it possible?