hello
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....
views:
16answers:
1
+1
A:
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
Matt S.
2010-09-16 20:44:23
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
Alx
2010-09-16 20:52:13
sry for the questions but how would i use intvalue?
Alx
2010-09-16 21:01:19
`[[array objectAtIndex:index] intValue];`
Matt S.
2010-09-16 21:08:01