当用户单击保存按钮时,我将用户的信息存储在 NSUserDefaults 类型的变量中。我想在启动应用程序时,可以将设置保存在相应的单元格中填充。所以这就是我在viewDidLoad方法中对应文件中所做的。
- (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);
}
代理和端口中的变量,我有信息,但是当我尝试更新单元格时它不起作用。我是 Null 的最后一个 NSLog 引用
怎么补救????
先感谢您