hi i am new in iOS
developer.
i have UITableView
and UITextField
. I set some different value in textfield and each textfield's value store in NSmutablearray
than i display this array in next screen. Displayed array value is perfect.
But my problem is when i switch back to the UITableView
screen and than again set new value in UITextField
and these UITextField
value store in NSmutablearray
.but problem is new value is override to old value. but i want both value store in NSArray
.
here my screen shot
summaryvc display perfect data.but when i back to the screen and select other item than click the placeorder.but problem is we cant get old selected item in summary screen.
here is button action code to store the array in Nsuserdefault. global.filteredArray is my nsmutablearray.dic value is my dictionary.
this is my array value
{
counts = 1;
"m_drycleaning_price" = 12;
"m_id" = 3;
"m_imagename" = d;
"m_iron_price" = 16;
"m_name" = "Coat(Man)";
"m_wash_price" = 14;
"m_washiron_price" = 13;
total = 12;
}
AppDelegate *myAppDelegate = [[UIApplication sharedApplication] delegate];
[myAppDelegate.arrayCounts addObject:dictValues];
myAppDelegate.arrayCounts[indexPath.row][@"counts"] = [NSString stringWithFormat:@"%d",(int)value];
myAppDelegate.arrayCounts[indexPath.row][@"total"] = [NSString stringWithFormat:@"%d",(int)y];
- (IBAction)placeorder:(id)sender
{
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
[userDefaults setObject:global.filteredArray forKey:@"def_orderarraylist"];
NSMutableArray *qualifiersArray = [NSMutableArray arrayWithArray:[userDefaults objectForKey:@"def_orderarraylist"]];
NSLog(@"qualifier array=%@",qualifiersArray);
[userDefaults synchronize];
}
please help!