This is what I have now:
- 4 JSON files
- ~ 2 000 000 lines in each file
~ 250MB each file
if let path = Bundle.main.path(forResource: "file_1", ofType: "json") { let url = URL(fileURLWithPath: path) do { let data = try Data(contentsOf: url, options: Data.ReadingOptions.mappedIfSafe) do { if let results = try JSONSerialization.jsonObject(with: data, options: JSONSerialization.ReadingOptions.mutableContainers) as? Array<[AnyHashable: Any]> { //do something here with that } } catch { print("error1: \(error)") } } catch { print("error2: \(error)") } }
But all I have is an error:
Message from debugger: Terminated due to memory issue
Is it possible at all to parse that 4 json files using iphone in Swift? I need to parse it within a few seconds.