Using NSArray.arrayWithObjects

I’m having issues using NSArray.arrayWithObjects with multiple arguments. Calling the method with a single argument doesn’t result in any issues.

The code I’ve tried with:

 NSArray.arrayWithObjects(
            Contacts.CNContactEmailAddressesKey(),
            Contacts.CNContactPhoneNumbersKey()
        );

Both arguments here are java Strings. According to the documentation, there should be no need to use VariadicArg wrappers in this case, but I’ve also tried using VariadicArg.createMap(arg, ObjCObjectMapper.class but that results in the same issue.

Maybe try to add a null as the last element of this array?

Ugh right. Thanks a lot, I forgot arrayWithObjects requires a null terminator arg.