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 7508331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:39:44+00:00 2026-05-29T22:39:44+00:00

I am browsing the UIKit framework header files and I see a lot of

  • 0

I am browsing the UIKit framework header files and I see a lot of instances where an anonymous enum is defined followed by a seemingly related typedef. Can someone explain what is going on here?

Does the UIViewAutoresizing type somehow (implicitly) refer to the enum declared in the previous statement? How would you refer to that enum type?

enum {
    UIViewAutoresizingNone                 = 0,
    UIViewAutoresizingFlexibleLeftMargin   = 1 << 0,
    UIViewAutoresizingFlexibleWidth        = 1 << 1,
    UIViewAutoresizingFlexibleRightMargin  = 1 << 2,
    UIViewAutoresizingFlexibleTopMargin    = 1 << 3,
    UIViewAutoresizingFlexibleHeight       = 1 << 4,
    UIViewAutoresizingFlexibleBottomMargin = 1 << 5
};
typedef NSUInteger UIViewAutoresizing;
  • 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-05-29T22:39:45+00:00Added an answer on May 29, 2026 at 10:39 pm

    The thing is that those are flags intended to use as bit mask, which leads to problems with enums. For example, if it would look like this:

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

    And you would call setAutoresizingMask: on a view with UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight, the compiler will complain and you must explicitly typecast it back to the UIViewAutoresizing type. The NSUInteger however can take the bit mask.

    Beside that, everything that lef2 said about NSUInteger not being an ObjC object.

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

Sidebar

Related Questions

In browsing around the Silverlight installation directory I see a number of framework DLLs
Browsing through the git documentation, I can't see anything analogous to SVN's commit hooks
Browsing the Internet, I found the new Ample SDK JavaScript framework. From their about
While browsing System.Zip (Delphi XE2) to see how it works, I found this function:
While browsing the code of some websites I sometimes notice that some JavaScript files
When browsing through Facebook pages the header and fixed footer section remain visible between
After browsing some old code, I noticed that some classes are defined in this
In browsing a JavaScript file, I see the following line: this.close = new Element('a',
I am browsing through hundreds of xml files. When I open them in notepad++
I'm browsing some C code. I ran into a variable that is defined in

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.