광어네 맛집
[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:22728x90
반응형
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
반응형
'Objective-C [레거시 뿌수기!] > Objective-C' 카테고리의 다른 글
[Objective C] this class is not key value coding-compliant for the key XXX (0) | 2022.11.18 |
---|---|
[Objective C] Static Method & Overloading (1) | 2022.09.30 |
[Swift Conversting] Enum 호환 (0) | 2022.08.29 |
[Swift Conversting] Dictionaray -> Model 전환 이슈 (0) | 2022.08.22 |
[Swift Library] Obective C에서 Swift Library 사용하기 (0) | 2022.06.21 |