The openssl key and iv as specified with -K and -iv are specified as a hex representation of the binary data.
From the openssl docs:
the actual key to use: this must be represented as a string comprised only of hex digits.
Both of the openssl keys in the example are 128 bits, for AES 256 they need to be 256 bits. The iv must be block size, 128 bits but in the above example the iv is only 64 bits.
I tested and this works:
uint8_t *zeros = calloc(1, 256);
NSData *keyData = [NSData dataWithBytes:zeros length:16];
NSData *ivData = [NSData dataWithBytes:zeros length:16];
NSData *clearData = [@"0123456789abcdef" dataUsingEncoding:NSUTF8StringEncoding];
NSData *encryptedData = [AESTest doCipher:clearData iv:ivData key:keyData context:kCCEncrypt error:&error];
[encryptedData writeToFile:@"/Users/dan/Desktop/encrypted.dat" atomically:YES];
openssl enc -aes-128-cbc -d -K 00000000000000000000000000000000 -iv 00000000000000000000000000000000 -in /Users/dan/Desktop/encrypted.dat -out /Users/dan/Desktop/decrypted.txt
cat /Users/dan/Desktop/decrypted.txt
0123456789abcdef
For the method doCipher
see this SO answer