I store the information of a user in a variable of type NSUserDefaults when the user clicks on the save button. I would like the launch of the application, the settings can be saved in the corresponding cells filled. So here's what I did in the corresponding file in the viewDidLoad method.
- (void)viewDidLoad
{
// [super viewDidLoad];
// Do any additional setup after loading the view.
if (self.navigationPaneBarButtonItem)
[self.navigationBar.topItem setLeftBarButtonItem:self.navigationPaneBarButtonItem
animated:NO];
//Initialise IndexPath
NSIndexPath *indexPathBroker = [NSIndexPath indexPathForRow:0 inSection:0];
NSIndexPath *indexPathPort = [NSIndexPath indexPathForRow:1 inSection:0];
NSUserDefaults *defaultConf;
defaultConf=[NSUserDefaults standardUserDefaults];
NSString * broker =[defaultConf stringForKey:@"broker"];
NSString *port= [defaultConf stringForKey:@"port"];
NSLog(@"Brokerdidload: %@ et Portdidload: %@",broker,port);
//Create strings and integer to store the text info
ConfigDetailEditTableCell *editCellBroker = (ConfigDetailEditTableCell *)[_tableView cellForRowAtIndexPath:indexPathBroker];
ConfigDetailEditTableCell *editCellPort = (ConfigDetailEditTableCell *)[_tableView cellForRowAtIndexPath:indexPathPort];
//set data
editCellPort.EditCellValue.text =port;
editCellBroker.EditCellValue.text=broker;
// [editCellBroker.EditCellValue setText:broker];
// [[editCellPort textLabel] setText:port];
// [[editCellBroker textLabel] setText:broker];
// [[editCellPort textLabel] setPlaceholder:port];
// [[editCellBroker textLabel] setPlaceholder:broker];
// editCellPort.EditCellValue.text =*/
NSLog(@"editCellPort.EditCellValue: %@ et editCellBroker.EditCellValue: %@",editCellPort.EditCellValue.text,editCellBroker.EditCellValue.text);
}
Variables in the broker and port, I have information but when I try to update the cell it does not work. The last NSLog that I am Null references
How to remedy????
Thank you in advance