I have checked this code until I am 'blue in the face', but I can't see why I get an error saying missing closing bracket.
If I add an additional bracket it then reports an additional 'Expected '}' in class?
I have counted 5 opening brackets and 5 closing brackets. I even checked to see whether I had mistakenly typed the wrong type of bracket elsewhere in the code!
Is this a bug?
If not what is the reason. for this error?
Code Block // // ExploreDataManager.swift // LetsEat3 // // Created by Tony Hudson on 16/04/2021. // import Foundation class ExploreDataManager { func fetch() { for data in loadData() { print(data) } } fileprivate func loadData() -> [[String: AnyObject]] { guard let path = Bundle.main.path(forResource: "ExploreData", ofType: "plist"), let items = NSArray(contentsOfFile: path) else { return [[:]] } return items as![[String: AnyObject]] } }
If I add an additional bracket it then reports an additional 'Expected '}' in class?
I have counted 5 opening brackets and 5 closing brackets. I even checked to see whether I had mistakenly typed the wrong type of bracket elsewhere in the code!
Is this a bug?
If not what is the reason. for this error?