Skip to content

PFObject doesn't allow NSNull values #667

@emkman

Description

@emkman

Contrary to documentation and the provided error message, PFObject (and PFUser) doesn't allow explicit NSNull values when set from an NSDictionary.

example code:

-(void)codeToTest {
    PFObject *testObject = [PFObject objectWithClassName:@"Foo"];
    [testObject setValuesForKeysWithDictionary:@{@"a": @"b",
                                               @"foo": [NSNull null]}];
    [testObject save];
}

Exception:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Can't use nil for keys or values on PFObject. Use NSNull for values.'

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions