Frequently used symbol “|” in Objective-C

前端 未结 4 1288
清歌不尽
清歌不尽 2020-12-11 10:11
self.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleWidth;

The source code is shown above. Wonder what the symbol \"|

4条回答
  •  攒了一身酷
    2020-12-11 10:42

    | is the bitwise OR operator in C (and therefore in Objective-C).

    See http://en.m.wikipedia.org/wiki/Bitwise_operations_in_C

    In the context you asked about, it's being used to combine two flag values.

提交回复
热议问题