How do I implement a bit array in C / Objective C

P i picture P i · Sep 19, 2010 · Viewed 9.4k times · Source

iOS / Objective-C: I have a large array of boolean values.

This is an inefficient way to store these values – at least eight bits are used for each element when only one is needed.

How can I optimise?

Answer

justin picture justin · Sep 19, 2010

see CFMutableBitVector/CFBitVector for a CFType option