0
func sortArrayBasedOnStartTime(_ array: NSArray) -> NSArray
{
  for eventDict in array
  {
       let startHourOfThisEvent : String = self.getStartHour((eventDict as! NSArray)["eventStartTime"] as! String)

       if(hourTemp as! String == startHourOfThisEvent)
       {
            arrSpecificHour.add(eventDict as! NSDictionary)
       }
   }
}
1
  • Where do you receive the error exactly? Upon adding an item to arrSpecificHour? Commented Oct 25, 2016 at 9:20

1 Answer 1

1

Here's your problem

(eventDict as! NSArray)["eventStartTime"]

You are converting a dictionary to an array, which obviously can't be accessed by string, arrays can be accessed only by integers.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.