Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
XCode enum help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Raconteur" data-source="post: 1064761" data-attributes="member: 147076"><p>Ok, I figured it out, but found another question in the process... isn't that how it always works? <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p></p><p>The typedef in the header is good.</p><p></p><p>Using it, though merely requires:</p><p>[CODE]</p><p>switch ([self difficultyLevel]) {</p><p> case EASY:</p><p> ...</p><p>}</p><p>[/CODE]</p><p></p><p>THAT works... but what is the point of giving the typedef a name, such as "DifficultyLevel"?</p><p></p><p>To me, [CODE]DifficultyLevel.EASY[/CODE] is much more readable and self-documenting than [CODE]EASY[/CODE].</p><p></p><p>Am I still missing something, or doing it wrong altogether?</p><p></p><p>Thanks!</p></blockquote><p></p>
[QUOTE="Raconteur, post: 1064761, member: 147076"] Ok, I figured it out, but found another question in the process... isn't that how it always works? :) The typedef in the header is good. Using it, though merely requires: [CODE] switch ([self difficultyLevel]) { case EASY: ... } [/CODE] THAT works... but what is the point of giving the typedef a name, such as "DifficultyLevel"? To me, [CODE]DifficultyLevel.EASY[/CODE] is much more readable and self-documenting than [CODE]EASY[/CODE]. Am I still missing something, or doing it wrong altogether? Thanks! [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
XCode enum help
Top