본문 바로가기

iPhone dev./에러 처리하기

A view can only be associated with at most one view controller at a time...

발생 에러: A view can only be associated with at most one view controller at a time...


해결방법:

Xcode 4.2(4.3?) 부터는 interface builder의 xib 안에서 view들이 아닌 view controller를 추가하면 위와 같은 에러가 난다.

stackoverflow에서 찾은 해결법:

This happened to me already twice in the newest Xcode release. In both cases I needed to make changes to the UIViewController's XIB file (In you case it would be MapViewController.xib:

BEFORE:

enter image description here

  1. Move main View out of View Controller's children:
  2. Remove View Controller from the XIB (it is not necessary since File's Owner should be of its Class already):

AFTER:

enter image description here

share|improve this answer
위와 같이 하면 오류가 사라진다. (나 같은 경우는 단순히 view controller만 제거하니 에러가 사라짐)


'iPhone dev. > 에러 처리하기' 카테고리의 다른 글

Storyboards are unavailable on iOS 4.3 and prior  (0) 2013.02.27