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

使用Objc+MJExtension,当json中有id->ID的情况时不会自动生成.m中的方法 #13

Open
ame017 opened this issue Oct 9, 2018 · 2 comments

Comments

@ame017
Copy link

ame017 commented Oct 9, 2018

比如json

                {
                    "id": 10,
                    "created_at": "2018-10-08 17:48:28",
                    "updated_at": null,
                    "status": 1,
                    "user_id": 33080,
                    "currency_id": 3,
                    "room_id": 23,
                    "room_no": 5,
                    "round": 1,
                    "num": "0.322000",
                    "cldepot_id": 0,
                    "capital": "0.000000",
                    "reward": "0.000000",
                    "unit": "ETH",
                    "cn_name": "以太坊"
                }

中包含id字段

用YYModel可以生成

+ (NSDictionary<NSString *,id> *)modelCustomPropertyMapper{
    return @{@"ID":@"id"};
}

的方法
但是用MJExtension,程序不会自动生成

+ (NSDictionary *)mj_replacedKeyFromPropertyName{
    return @{@"ID": @"id"};
}

不知道是我的BUG还是程序的bug

@BIMiracle
Copy link

https://github.com/tryEvething/ESJsonFormatForMac
这是我的更新版本,顺便解决了关闭窗口后重新打开的问题,不过当时项目是下下来的,也没有想过会改,导致现在无法pull request(因为我是强制Push的😅)

@ame017
Copy link
Author

ame017 commented Nov 2, 2018

@tryEvething 哎!黄花菜都凉了!因为这个我把整个项目都改用了YYModel😢

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

2 participants