Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enum 加@objc标签解析时会崩溃 #53

Open
yelin1597532 opened this issue Dec 22, 2020 · 3 comments
Open

enum 加@objc标签解析时会崩溃 #53

yelin1597532 opened this issue Dec 22, 2020 · 3 comments

Comments

@yelin1597532
Copy link

转换代码如下:

@objcMembers class CustomerQuestionTypeResp: NSObject, Convertible {

    @objc enum QuestionType: Int, ConvertibleEnum {
        case singleSelect = 0   
        case multiSelect = 1   
        case unsureSelect = 2   
        case judge = 3      
        case fillBlank = 4    
        case input = 5        
        case material = 6   
    }
    var type: QuestionType = .singleSelect
    
    required override init() {
        super.init()
    }
}

QuestionType在不标记@objc 的情况下解析正常,加了@objc标签后估计是偏移量有变化导致解析崩溃,崩溃位置如下:
截屏2020-12-22 上午11 39 55

@xtaykhksghy
Copy link

我拿你这代码试了下,没发现问题

@DamonHu
Copy link

DamonHu commented Feb 25, 2021

碰到了同样的报错,解析服务器返回的json数组时碰到了

syncList = responseData.kj.modelArray(LZNoteModel.self)

LZNoteModel的成员变量有一个enum含有@objc 标签,移除了没问题,加上就会出现这个报错

@wolfcon
Copy link
Contributor

wolfcon commented Sep 16, 2021

可能跟这个相关

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants