Post

Replies

Boosts

Views

Activity

unpair a Bluetooth accessory programmatically and remove it in Bluetooth Settings
Hello,Is there a way to unpair a Bluetooth accessory programmatically instead done by the user to manually "forget" it in Bluetooth Settings? I am using the Core Bluetooth framework.If not so, then how many Bluetooth devices can be there present in the list in Bluetooth Settings?I would really appreciate if someone can help me here.Thanks,Marc.
5
0
2.2k
Dec ’22
User Defaults Not Working When Trying to Save the Settings Information
Hi,When I try to save the information provided by the user on the Settings view and come back to the settings again it does not load the previous stored information. This is how I am saving:After entering all the fields and pressing the "submit" button, I save the information using User Defaults:let advancedSettingArray = [self.custCodeTextField.text, self.pcsAddrTextField.text]UserDefaults.standard.set(advancedSettingArray, forKey: "ArrayKey")UserDefaults.standard.synchronize()When I navigate back to the Settings page, I use the following code in ViewDidLoad() :let defaults = UserDefaults.standardif let myArray = defaults.object(forKey: "ArrayKey") as? [String] { print(myArray)}It does not work, somehow. Can someone please tell what I am doing wrong.Thanks,Marc.
14
1
11k
Oct ’22
unpair a Bluetooth accessory programmatically and remove it in Bluetooth Settings
Hello,Is there a way to unpair a Bluetooth accessory programmatically instead done by the user to manually "forget" it in Bluetooth Settings? I am using the Core Bluetooth framework.If not so, then how many Bluetooth devices can be there present in the list in Bluetooth Settings?I would really appreciate if someone can help me here.Thanks,Marc.
Replies
5
Boosts
0
Views
2.2k
Activity
Dec ’22
User Defaults Not Working When Trying to Save the Settings Information
Hi,When I try to save the information provided by the user on the Settings view and come back to the settings again it does not load the previous stored information. This is how I am saving:After entering all the fields and pressing the "submit" button, I save the information using User Defaults:let advancedSettingArray = [self.custCodeTextField.text, self.pcsAddrTextField.text]UserDefaults.standard.set(advancedSettingArray, forKey: "ArrayKey")UserDefaults.standard.synchronize()When I navigate back to the Settings page, I use the following code in ViewDidLoad() :let defaults = UserDefaults.standardif let myArray = defaults.object(forKey: "ArrayKey") as? [String] { print(myArray)}It does not work, somehow. Can someone please tell what I am doing wrong.Thanks,Marc.
Replies
14
Boosts
1
Views
11k
Activity
Oct ’22