i am trying to add individual integers to a certain array
my array is in this form
array= number +1
how can i make lets say number be a array = 2 +3 +1
where 2 and 3 are two different distinct obhects that should be commutatively added.
i hope i am clear. I dont want the numbers to be added so that the aboce equations would equal 0. i want it to be equal to 2 then 3 then 1....
Add a comment
|
1 Answer
NSMutableArray????
Do something like this:
int d = 0;
for (d = 0; i <100; i++)
{
[array addObject:[[NSString alloc] initWithFormat:@"%d", d]];
}
or whatever you want it to be
edit:
To add the numbers, just use intvalue
3 Comments
Alex Stelea
no, i have an array that contains numbers that correspond to questions in a text file that get displayed. i want to be able to make lets say a fixed way of displayed these views in an order. if i do array = 1 it will show me the 2nd question so i want to do smthing like array = 1+3 to be able to see the 2nd and 4th questions
Alex Stelea
sry for the questions but how would i use intvalue?
Matt S.
[[array objectAtIndex:index] intValue];