top of page

Cannot assign value of type 'Int' to type 'String?'エラー

  • 執筆者の写真: しゅう
    しゅう
  • 2018年12月2日
  • 読了時間: 1分

更新日:2018年12月8日


解決策

Cannot assign value of type 〇〇 to type ☆☆

これは「〇〇という型ではなく、☆☆という型じゃない?」というエラーです。

ですので、変数の型変換を行えば解決します。


Cannot assign value of type 'Int' to type 'String?'

の場合は、コードを

String(変数名)

にすると解決します。


型変換の詳しい情報は、https://i-app-tec.com/ios/int-string-double.html を参考にしてみてください!

Comments


Never Miss a Post. Subscribe Now!

I'm a paragraph. Click here to add your own text and edit me. It's easy.

© 2023 by Kathy Schulders. Proudly created with Wix.com 

  • Grey Twitter Icon
bottom of page