LoginSignup
3
1

More than 5 years have passed since last update.

Xcode7にアップグレードした時に出たエラー

Posted at

はじめに


 Xcode7にアップグレードした時に、大体のコードは勝手にコンバートしてくれたけど、エラーが出た箇所が1つあったので、書いておきます。

内容


 まずは、元コード。

myTabBarController?.setViewControllers(myTabs as [AnyObject], animated: false)

 このときに出たエラーが、

 Cannot convert value of type '[AnyObject]' to expected argument type '[UIViewController]?'
 だったので、

myTabBarController?.setViewControllers(myTabs as! [UIViewController], animated: false)

 これで直りました。AnyObjectが使えなくなったのかな??

警告で気になるけどよくわからないところ


private var window: UIWindow?

 警告で、Non-@objc property 'window' cannot satisfy optional requirement of @objc protocol 'UIApplicationDelegate'って出るんだけど、Obj-C使ってないからどういうことかよくわからない。。。

終わりに


 Stack Overflowには、けっこう対処法書いてあるけど、日本語訳されてるのがまだ少ないから少し大変だった。。

参考


3
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1