It seems you have a memory management problem here when you change your variables. You are using two pointers. It seems wrong to me.
version = CFSwapInt16BigToHost((int*)([databuffer bytes]));
or better
version = CFSwapInt16BigToHost([databuffer bytes]);
Make sure the arg and return values ββmatch the function as per the manual!
in the Apple manual this is indicated about this function:
CFSwapInt16HostToBig
16- .
uint16_t CFSwapInt16HostToBig (
uint16_t arg
);
* Arg *
, .
. big-endian, arg .