現在、次のコードを使用して、Bluetooth デバイスの NSUUID をコア データに保存しようとしています。
let appDel: AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
let context = appDel.managedObjectContext
let newDevice = NSEntityDescription.insertNewObjectForEntityForName("Devices", inManagedObjectContext: context)
newDevice.setValue(connectingPeripheral.identifier, forKey: "identifier")
newDevice.setValue(TextField.text, forKey: "name")
do{
try context.save()
} catch _ as NSError{
}
でエラーが発生します
newDevice.setValue(connectingPeripheral.identifier, forKey: "identifier")
NSUUID を SQLite データベースに保存できないためです。私が考えることができる唯一の方法は、NSUUIDを文字列に変換してSQLiteに保存することです。しかし、それはあまり適切ではありません。NSUUID を SQLite に保存する方法を教えてもらえますか? ありがとうございました