Skip to content

"Yes" or specific string map to boolean type? #21

@Junywing

Description

@Junywing

I have JSON like this

"login_success" : "Yes",
"isAdult": "N",
...

and

I want to mapping the result to below property
property BOOL bSuccess;
property BOOL isAudlt;

currently, the result map to the NSString property and then call method if the string is "YES" , bSuccess = YES...

is there any easy way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions