In CoreDataHelpers.swift, the following code segment can be found.
class func updateSingleDorm(dormName: String, json: JSON, completion: ()->() ) {
let dateFormatter = DateFormatter();
dateFormatter.locale = Locale(identifier: "en_US")
dateFormatter.dateFormat = "yyyy-mm--dd hh:mm:ss"
let index = self.find(dormName)
let dormStatuses = Array(json["location"]["rooms"])[index]
The line of interest is the fourth line inside the function in which find(String) is called on self.
However class CoreDataHelpers currently does not contain a find method.
Resolve this issue by either
- Implement the method find in CoreDataHelpers that take in as parameters an string array and a target string and perform an efficient search over the array and return the index. Due to the nature of datastructure given, which is a hashset, there might be a better way of searching for the index but one need not worry about negligible efficiency for the time being.
- Change the call to the method to another one that is correct and provide the same functionality.
In CoreDataHelpers.swift, the following code segment can be found.
The line of interest is the fourth line inside the function in which find(String) is called on self.
However class CoreDataHelpers currently does not contain a find method.
Resolve this issue by either