Instance member cannot be used on type

后端 未结 8 1895
遥遥无期
遥遥无期 2020-11-29 04:13

I have the following class:

class ReportView: NSView {  
    var categoriesPerPage = [[Int]]()
    var numPages: Int = { return categoriesPerPage.count }
}
<         


        
8条回答
  •  暖寄归人
    2020-11-29 04:57

    I kept getting the same error inspite of making the variable static. Solution: Clean Build, Clean Derived Data, Restart Xcode. Or shortcut Cmd + Shift+Alt+K

    UserNotificationCenterWrapper.delegate = self
    
    public static var delegate: UNUserNotificationCenterDelegate? {
            get {
                return UNUserNotificationCenter.current().delegate
            }
            set {
                UNUserNotificationCenter.current().delegate = newValue
            }
        }
    

提交回复
热议问题