I tired to build an macOS application (Xcode 12, SwifUI) for my IOS app. To fetch json data from my website I need a fetch request (no API key). I found several samples on medium, hackingwithswift etc., but I always get keeping the same error.
[logging] volume does not support data protection, stripping SQLITE_OPEN_FILEPROTECTION_* flags\
I'm wondering why I get this error just on the macOS project, because my IOS version is working fine.
class FetchDeviceInfo: ObservableObject {
@Published var deviceInfo = [DeviceData]()
init() {
let url = "https://yourURL"
let session = URLSession(configuration: .default)
session.dataTask(with: URL(string: url)!) { (data, _, _) in
guard let json = data else{return}
do{
let data = try JSONDecoder().decode([DeviceData].self, from: json)
print(images)
DispatchQueue.main.async {
self.deviceInfo = data
}
}
catch{
print(error.localizedDescription)
}
}
.resume()
}
}
I would be pleased if somebody could help me.
Edit: I found a way to fetch my data, but I still get the error message. I tested it as well with an "professional" Json API, but the error still occurs, so I hope its not my fault having a non professional JSON Server.