O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Byte Ordering

The byte ordering functions are used to convert primitive data type values from big-endian to little-endian, and vice versa.

NSConvertHostDoubleToSwapped

NSSwappedDouble NSConvertHostDoubleToSwapped(double x)

NSConvertHostFloatToSwapped

NSSwappedFloat NSConvertHostFloatToSwapped(float x)

NSConvertSwappedDoubleToHost

double NSConvertSwappedDoubleToHost(NSSwappedDouble x)

NSConvertSwappedFloatToHost

float NSConvertSwappedFloatToHost(NSSwappedFloat x)

NSHostByteOrder

unsigned int NSHostByteOrder(void)

NSSwapBigDoubleToHost

double NSSwapBigDoubleToHost(NSSwappedDouble x)

NSSwapBigFloatToHost

float NSSwapBigFloatToHost(NSSwappedFloat x)

NSSwapBigIntToHost

unsigned int NSSwapBigIntToHost(unsigned int x)

NSSwapBigLongLongToHost

unsigned long long NSSwapBigLongLongToHost(unsigned long long x)

NSSwapBigLongToHost

unsigned long NSSwapBigLongToHost(unsigned long x)

NSSwapBigShortToHost

unsigned short NSSwapBigShortToHost(unsigned short x)

NSSwapDouble

NSSwappedDouble NSSwapDouble(NSSwappedDouble x)

NSSwapFloat

NSSwappedFloat NSSwapFloat(NSSwappedFloat x)

NSSwapHostDoubleToBig

NSSwappedDouble NSSwapHostDoubleToBig(double x)

NSSwapHostDoubleToLittle

NSSwappedDouble NSSwapHostDoubleToLittle(double x)

NSSwapHostFloatToBig

NSSwappedFloat NSSwapHostFloatToBig(float x)

NSSwapHostFloatToLittle

NSSwappedFloat NSSwapHostFloatToLittle(float x)

NSSwapHostIntToBig

unsigned int NSSwapHostIntToBig(unsigned int x)

NSSwapHostIntToLittle

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required