Quote:
Originally Posted by smithdale87
Assuming your "array" has NSNumber objects..
Code:
int sum=0;
for(int x=0; x < [array count]; x++)
{
sum += [[array objectAtIndex:x] intValue];
}
//to set the text
label.text = [NSString stringWithFormat:@"%d", sum];
|
Um I'm pretty sure my array dosent have NSNumber objects. It's just a normal NSMutable array initwithObjects:@"1",@"2","3",nil.
How do I make it into that? Thanks!