Problem writing file on IOS in Firemonkey


I have a login screen in our mobile app in Firemonkey.
I use the following routine to save the entered parameters and read them again when the user launches the application again.
The code works fine on Android, but in IOS I get an error that the directory does not exist.
procedure TLoginFrm.Save_login_parameters;
var SettingsIniFile: TMemIniFile;
LDirectory: string;
LFileName: string;
LDirectory := TPath.GetHomePath + TPath.DirectorySeparatorChar + ‘Settings’;
LFileName := TPath.GetHomePath + TPath.DirectorySeparatorChar + ‘Settings’ + TPath.DirectorySeparatorChar + ‘WaveDeskSettings.ini’;
SettingsIniFile := TMemIniFile.Create(LFileName);
SettingsIniFile.WriteString(‘Login’, ‘Account’, EditAccount.Text);
SettingsIniFile.WriteString(‘Login’, ‘Login’, EditLogin.Text);

Comments are closed.