Skip to content

crash:setObjectForKey: object cannot be nil  #87

@1257331501

Description

@1257331501
            case SQLITE_TEXT:
            {
                const char *value = (const char*)sqlite3_column_text(statement, i);
                [result setObject:[NSString stringWithCString:value encoding:NSUTF8StringEncoding] forKey:columnName];
                break
          }

value 为nil 或者 [NSString stringWithCString:value encoding:NSUTF8StringEncoding] 这个为nil 造成的。
是不是要改成这样
NSString *valueString = [NSString stringWithCString:value encoding:NSUTF8StringEncoding] ?: @""
[result setObject:valueString forKey:columnName];

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