본문 바로가기

Swift

[에러처리] does not have a reuseIdentifier

아래와 같은 에러 메시지를 만났다.

reuseIdentifier가 없다고 해서 이 부분만 집중적으로 확인해보았는데, 여기저기 뒤져본 결과 클래스를 등록하지 않아서 그렇다고 한다.


2016-04-27 00:18:02.398 BurstAnimator[24405:7733921] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'the cell returned from -collectionView:cellForItemAtIndexPath: does not have a reuseIdentifier - cells must be retrieved by calling -dequeueReusableCellWithReuseIdentifier:forIndexPath:'


그래서 Main.Storyboard에서 확인해보니 Cell에 대한 클래스를 설정을 하지 않은 것을 발견하였다.


위 그림과 같이 클래스를 설정하였더니 이 오류는 해결되었다.

(이 뒤에 fetal error를 만나서 더 멘붕에 빠졌다는 ㅡ,.ㅡ;;)