Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8328341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:24:31+00:00 2026-06-09T01:24:31+00:00

I kinda like enums . Their syntax is arcane-looking, and I’ve yet to find

  • 0

I kinda like enums. Their syntax is arcane-looking, and I’ve yet to find a definitive point of reference on their undeniably proper use.. but let’s say I had..

typedef enum {
    OrientTop,
    OrientBottom,
    OrientFiesta
}   Orient;

I’d love to be able, as I do with, for example, other constants when multiple chocies may be applicable/ required, just do…

 self.orientation = OrientTop | OrientFiesta;  // NO NO WORK-O!

just like one does with…

self.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;

or also..

it = [[NSThing alloc]initOptions: NSStupid | NSSpicy | NSSassy];

and it would also be nice.. instead of…

 if ((o == OrientTop ) || ( o == OrientBottom))

i could just use…

if (o == OrientTop || OrientBottom) 

and most importantly… how to check multiple cases, á la..

switch (orientation) {
    case OrientTop | OrientBottom:

Or something, of the sort..
ugh, oh.. you guys are too slow.. so, duh.. i just need to…

case OrientLeft:
case OrientRight:  { // blah blah blah
     break;        }

(But for the first part.. ) What is the extra “secret sauce” that Apple / smarter people than me.. are using to give their typedef‘s that extra zing that make mine taste so, ech..bland.. in comparison?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:24:33+00:00Added an answer on June 9, 2026 at 1:24 am

    It appears as if typedefs such as NSViewWidthSizable are actually bitmasks, which allow the nice ORing operations you so enjoy. In the headers for some UIKit elements, you can see what I mean:

    enum {
        UIViewAutoresizingNone                 = 0,
        UIViewAutoresizingFlexibleLeftMargin   = 1 << 0,
        UIViewAutoresizingFlexibleWidth        = 1 << 1,
        UIViewAutoresizingFlexibleRightMargin  = 1 << 2,
        UIViewAutoresizingFlexibleTopMargin    = 1 << 3,
        UIViewAutoresizingFlexibleHeight       = 1 << 4,
        UIViewAutoresizingFlexibleBottomMargin = 1 << 5
    };
    typedef NSUInteger UIViewAutoresizing;
    

    I snatched that right off a very helpful site that explains in more detail, but you can also examine the enumeration of any constant by holding Command ⌘ and clicking the constant or typedef.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a webpage with a form, which looks kinda like this: @using (Html.BeginForm(MyAction,
How can i rewrite all external links with a single onmousedown event? Kinda like
I tried to make a layout look like it It looks like kinda button
i'd like to write a wrapper for a C++ framework. this framework is kinda
the Requirement in simple words goes like this. Its a charting Application ( kinda
So, my list of models in app/models is getting kinda long, and I'd like
I often use enums like public enum Side { Left, Top, Right, Bottom };
I've been struggling with this for a while and have yet to find an
So I looked into this enum type, and it kind of seems like a
Kind of like this question I have many text snippets that I use many,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.