Hi,
i have a double variable in my application and i update some values to it in viewDidLoad method and want to use it later in one of the delegate method of tableview but the variable is not able to retain the value. I am declaring it as follows:
double subTtl;
@property(nonatomic,assign) double subTtl;
mycode for viewdidLoad
subTtl = 0;
for (int i = 0; i<[pizzaAppDel.arrOrders count]; i++) {
[pizzaAppDel.arrOrderDetails addObject:@"1"];
subTtl = subTtl + [[(NSDictionary*)[pizzaAppDel.arrOrders objectAtIndex:i] objectForKey:@"price"] doubleValue];
}
NSLog(@"%@",[NSString stringWithFormat:@"%.2f",subTtl]);
This is how i m using it in my tableview delegate method:
lblTtlPrice.text = [@"Subtotal: $" stringByAppendingString:[NSString stringWithFormat:@"%.2f",subTtl]];
i am synthesising it in .m file and saving some values, i can see the values inside the variable but when i try to use it later i get nothing from it, variable returns empty.