ios - Spontaneous Swift Compiler Errors -
my project had 0 errors/warning xcode 6 beta 1 - xcode 6 beta 6. when updated beta 7, xcode started telling me have 170 errors in project. spritekit methods/objects/properties. still giving me errors on actual release of xcode 6. know these things shouldn't problem, because have had absolutely no trouble building in past exact same code. give example:
this kind of stuff happening on project. have uninstalled/reinstalled xcode betas, release several times, no avail. biggest project yet, , i'm incredibly upset can't figure out. hate have rewrite whole project in objective-c. called apple developer support, , things recommend had tried , didn't work. can't seem find else having similar problems online.
thanks help.
i bet it's implicitly unwrapped optionals turned "normal" optionals.
try appending implicitly unwrapped optional operator !
in each line physicalbody
referenced, such as:
blocksprite.physicalbody!.categorybitmask = ...
if solves problem, safer code suggest assign new instance of skphysicalbody
variable, initialization, assign variable blocksprite.physicalbody
. way don't have deal optionals.
as general rule, if 100% sure optional contains non nil value, it's better avoid implicitly unwrapped optionals - less headaches @ runtime, if happens unwrapped variable nil.
Comments
Post a Comment