• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Function to retrieve autoresizingMask ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Function to retrieve autoresizingMask ?


  • Subject: Re: Function to retrieve autoresizingMask ?
  • From: Andrew Bowman <email@hidden>
  • Date: Tue, 6 Jun 2006 19:04:46 -0700


On Jun 6, 2006, at 6:10 PM, Eric Morand wrote:

Though in this particular case the result will be the same, that is, IMO, better expressed as

(NSViewWidthSizable | NSViewHeightSizable)]

I've always thought that + and OR were the exact same thing in logical operations...


Test the result of -autoresizingMask with the bitwise operators...

The bitwise operators ? Could you give me an example ?



Bitwise operators include | (OR), & (AND), ~ (NOT), and ^ (XOR).

To check values in a bitmask, use &.

For example, if you wanted to know if the NSViewHeightSizable bit was on, you would use:

if ([aView autoresizingMask] & NSViewHeightSizable )

As for setting bits, it's best to OR them into your mask (mask |= NSViewHeightSizable) unless you're sure you want to clear the bitmask with the exception of what you're setting it to.

When clearing bits, AND the mask with the negation of the bit (mask &= ~NSViewHeightSizable). Also, don't confuse ~ (bitwise NOT) with ! (logical NOT), they are not the same thing.


- Andrew Bowman _______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Function to retrieve autoresizingMask ?
      • From: Eric Morand <email@hidden>
References: 
 >Function to retrieve autoresizingMask ? (From: Eric Morand <email@hidden>)
 >Re: Function to retrieve autoresizingMask ? (From: Jim Correia <email@hidden>)
 >Re: Function to retrieve autoresizingMask ? (From: Eric Morand <email@hidden>)

  • Prev by Date: is it possible to recover source from .o or .ob files?
  • Next by Date: Re: NSUserKeyEquivalents syntax
  • Previous by thread: Re: Function to retrieve autoresizingMask ?
  • Next by thread: Re: Function to retrieve autoresizingMask ?
  • Index(es):
    • Date
    • Thread