광어네 맛집

[Objective C] Method Cannot be in an @objc extension of a class (without @nonobjc) because the type of the parameter cannot be represented in Objective-C 본문

Objective-C [레거시 뿌수기!]/Objective-C

[Objective C] Method Cannot be in an @objc extension of a class (without @nonobjc) because the type of the parameter cannot be represented in Objective-C

Lautner Jacob 2022. 11. 9. 16:22
728x90
반응형

Swift로 코딩을 한 뒤 Objective C에 적용시키려니 다음과 같은 에러가 떴다

'Method Cannot be in an @objc extension of a class (without @nonobjc) because the type of the parameter cannot be represented in Objective-C'

 

원인은 간단한데 Objective C 에서는 맞지 않다는 거

그럼 에러가 난 부분은 다양할 수 있으나 저 같은 경우에는 enum 처리할 때 에러가 났음

 

기존 코드

enum Style {
   case a, b
}

 

 

바꾼 코드

@objc enum Style: Int {
   case a, b
}

 

 

오늘은 간단하게 해결!

728x90
반응형