Skip to content

Use of method that is unavailable natively #5

Description

@MinhyukPark

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

  1. 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.
  2. Change the call to the method to another one that is correct and provide the same functionality.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions