<< operator in objective c enum?

后端 未结 6 1203
别跟我提以往
别跟我提以往 2021-02-04 05:46

I was looking for something and got in to this enum is apple UITableViewCell.h.

I am sorry if this is trivial but I wonder/curious what is the point of this.

I

6条回答
  •  故里飘歌
    2021-02-04 06:13

    Its actually BItwise shift operator

    <<  Indicates the bits are to be shifted to the left.
    >>  Indicates the bits are to be shifted to the right.
    

    So in your statement the value of 1 << 0 is 1 and 1 << 1 is 2

提交回复
热议问题