In UITableView.h, in the interface declaration for UITableView, there is an ivar struct _tableFlags. The struct's members are all defined as unsigned int, however the title of each member is followed by a colon and then a number.
struct {
unsigned int dataSourceNumberOfRowsInSection:1;
unsigned int dataSourceCellForRow:1;
…
unsigned int longPressAutoscrollingActive:1;
unsigned int adjustsRowHeightsForSectionLocation:1;
unsigned int customSectionContentInsetSet:1;
} _tableFlags;
Cocoa tends to make common use of this syntax in its header files, but I've no clue what it means and what its function is. What does the colon and the number following the member title mean?
These are bit fields. The number after the colon is the number of bits the variable takes in the structure.
See also: how to declare an unsigned int in a C program
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With