Skip to content

Allow passing TypedArray to NSArray #59

@triniwiz

Description

@triniwiz

We cannot pass TypedArrays e.g Uint8Array to methods expecting NSArray

const encoded = new TextEncoder().encode('Osei');
const n = NSArray.arrayWithArray(encoded as any);
const isEqual = () => {
	return encoded[0] === n[0] &&
		encoded[1] === n[1] &&
		encoded[2] === n[2] &&
		encoded[3] === n[3]
}
console.log('isEqual', isEqual());

it will crash at creating the new array with the following
[NSDataAdapter count]: unrecognized selector sent to instance 0x60000005fa40

but in JSC it works fine

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions