Method load() defines Objective-C class method 'load', which is not permitted by Swift 1.2

前端 未结 5 1577
一个人的身影
一个人的身影 2020-12-03 02:56

I\'m using Parse and I\'m creating a PFObject subclass conforming to the protocol PFSubclassing! It was working all fine, but now I\'m using Swift 1.2 and it gives me this

5条回答
  •  再見小時候
    2020-12-03 03:29

    Try this :

    override class func initialize() {
       var onceToken : dispatch_once_t = 0;
       dispatch_once(&onceToken) {
          self.registerSubclass()
       }
    }
    

    The Parse documentation has been updated : https://www.parse.com/docs/ios/guide#objects-subclassing-pfobject

提交回复
热议问题