ios - SceneKit object from function does not appear in Simulator -
hello trying run 2 examples on xcode. first apple's demobots example , other coin push example found on github. both times same single error, 'method not override method superclass' , stuck on best way correct these.
these respective lines of code
1.
override func supportedinterfaceorientations() -> int { if uidevice.currentdevice().userinterfaceidiom == .phone { return int(uiinterfaceorientationmask.allbutupsidedown.rawvalue) } else { return int(uiinterfaceorientationmask.all.rawvalue) } }
2.
override func observevalueforkeypath(keypath: string?, ofobject object: anyobject?, change: [string: anyobject]?, context: unsafemutablepointer<void>) { // check if kvo notification need. if context == &progressscenekvocontext && keypath == "fractioncompleted" && object === progress { // update progress ui on main queue. dispatch_async(dispatch_get_main_queue()) { guard let progress = self.progress else { return } // update progress bar match amount of progress completed. self.progressbarnode.size.width = self.progressbarinitialwidth * cgfloat(progress.fractioncompleted) // display contextually specific progress description. self.loadinglabelnode.text = progress.localizeddescription } } else { super.observevalueforkeypath(keypath, ofobject: object, change: change, context: context) } }
in case (1), base class uiviewcontroller
has method supportedinterfaceorientations
signature () -> uiinterfaceorientationmask
, not () -> int
. error message telling about, is, method provide implementation not override method base class, instead new method available in sub-class only.
i think case (2) similar story.
Comments
Post a Comment