gpt4 book ai didi

c++ - iOS枚举为什么用十六进制而不是十进制?

转载 作者:太空宇宙 更新时间:2023-11-04 07:51:01 24 4
gpt4 key购买 nike

<分区>

typedef NS_OPTIONS (NSInteger, YYTextLineStyle) {
// basic style (bitmask:0xFF)
YYTextLineStyleNone = 0x00, ///< ( ) Do not draw a line (Default).
YYTextLineStyleSingle = 0x01, ///< (──────) Draw a single line.
YYTextLineStyleThick = 0x02, ///< (━━━━━━━) Draw a thick line.
YYTextLineStyleDouble = 0x09, ///< (══════) Draw a double line.

// style pattern (bitmask:0xF00)
YYTextLineStylePatternSolid = 0x000, ///< (────────) Draw a solid line (Default).
YYTextLineStylePatternDot = 0x100, ///< (‑ ‑ ‑ ‑ ‑ ‑) Draw a line of dots.
YYTextLineStylePatternDash = 0x200, ///< (— — — —) Draw a line of dashes.
YYTextLineStylePatternDashDot = 0x300, ///< (— ‑ — ‑ — ‑) Draw a line of alternating dashes and dots.
YYTextLineStylePatternDashDotDot = 0x400, ///< (— ‑ ‑ — ‑ ‑) Draw a line of alternating dashes and two dots.
YYTextLineStylePatternCircleDot = 0x900, ///< (••••••••••••) Draw a line of small circle dots.
};

这段代码是我在一个框架上看到的,一般枚举值都用十进制,但是这段代码用十六进制,有什么好处?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com