Friday, July 2, 2010

Add and Get double value or numbers in a mutable array in iphone.

        
        code here :


        NSString *str = @"1.22222222";
double d = [str doubleValue];
arrForDoubleValue = [[NSMutableArray alloc] init];
[arrForDoubleValue addObject:[NSNumber numberWithDouble:d]];
for(int i = 0; i<[arrForDoubleValue count];i++)
{
double a = [[arrForDoubleValue objectAtIndex:i]doubleValue];
NSLog(@"%.8lf",a);
}

No comments:

Post a Comment