3

I've built an app in Xcode 6.2 and it was running fine but when I moved it Xcode 6.3 on another system I'm getting a lot of Swift compiler errors.

Most of them are like "AnyObject is not convertible to NSArray", "AnyObject is not convertible to NSNumber"

Sorry I could not upload any image.

Matt
  • 1,711
  • 18
  • 20
  • 1
    Xcode 6.3 uses the Swift 1.2 version and there are some languages changes, the only way to go through is get back to Xcode 6.2 or "fix" your code to compile with the 1.2 – tkanzakic Apr 18 '15 at 10:11
  • @tkanzakic is that the only option? evrytime i move my code i have to edit them? – Matt Apr 18 '15 at 10:14
  • 1
    Swift 1.1 and 1.2 are pretty much incompatible (such as `as` vs `as!`). Most changes are documented in the Xcode 6.3 release notes. Xcode has "Convert to latest Swift syntax" option, but then you cannot compile it with Xcode 6.2 anymore. – Martin R Apr 18 '15 at 10:16
  • Compare http://stackoverflow.com/questions/29568309/xcode-6-3-and-swift-1-1. – Martin R Apr 18 '15 at 10:19
  • @Matt: You have to convert the single time that you go from Swift 1.1 to Swift 1.2. You never go back. – gnasher729 Apr 18 '15 at 17:32

2 Answers2

2

I would strongly advise reading the release notes in order to get a rough idea of what has/hasn't been changed.

There are some major syntactic modifications and a few depreciations, which you will have to manually fix in your code.

Vatsal Manot
  • 17,695
  • 9
  • 44
  • 80
  • 1
    I think this is a perfectly fine answer. It is advice that not only solves the poster's immediate problem, but will solve more problems that he will have, and it is something that can be applied to many other problems he will have in the future. – gnasher729 Apr 18 '15 at 17:34
  • 1
    The important part of the answer wasn't the link. It was the advice "read the release notes", which applies to any release notes with any software that you ever use. The answer stays valid for people who upgrade from Xcode 6.3 to Xcode 7.0. – gnasher729 Apr 20 '15 at 07:28
0

For the problem of anyObjects I can help you. You can replace anyObjects by "first" so there is nothing difference. Also there are a lot of changes, likes, when you have to put as, you also have to put an ! (as!) like "name as! SKNode()". You can take a look to the release nodes for more information.