LoginSignup
9
5

More than 5 years have passed since last update.

ViewControllerにOutletを作成できない問題

Posted at

問題

Swift歴4日(時間的には20時間ぐらいw)で
http://easyramble.com/swift-todo-app-tutorial.html を参考にToDoアプリを作っていて下記のエラーに遭遇したので、後続のために一応自分の解決方法を残しておく。

Could not insert new outlet connection: Could not find any information
for the class named HogeViewController

参考URL

他の方が他の要因でおきた場合の解決方法の記事があるため、先に掲載させていただく。

Xcode でCould not insert new outlet connection が出て story board と controller の紐付けができなくなった時

Could not insert new outlet connectionエラーへの対処

【Xcodeエラー】Could not insert new outlet connection: Could not find any information for the class named ViewControllerの対処法

自分が解決した方法

StoryboardのオブジェクトをViewControllerにOutletとして作成して変数としてアクセスできるようにしたいが、下のエラーでOutletを作成できない。

Could not insert new outlet connection: Could not find any information
for the class named HogeViewController

上の記事を参考にTodoアプリを作成中に一度プロジェクトを削除して、同名のプロジェクトとして作り直したのが原因で、その時に同名のViewControllerが作成されていたため起きた問題だった。

Xcode でCould not insert new outlet connection が出て story board と controller の紐付けができなくなった時を参考に
rm -rf ~/Library/Developer/Xcode/DerivedData/<old project name>で削除済みのプロジェクトのフォルダを削除し、Xcodeを再度開くと解決された。

所感

主にweb(Rails)エンジニアをしてるわけだが、iOS周りが全くわからずエラーが出た時の無力感がすごい

9
5
0

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
9
5