• 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: Eric Morand <email@hidden>
  • Date: Wed, 7 Jun 2006 11:04:41 +0200

Thanks to both of you Nick and Andrew !

Your help was very valuable.



Le 7 juin 06 à 04:04, Andrew Bowman a écrit :


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
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>)
 >Re: Function to retrieve autoresizingMask ? (From: Andrew Bowman <email@hidden>)

  • Prev by Date: Re: Custom IB palette: Is there a way to use parent's IB inspector and also add new features to it?
  • Next by Date: Re: is [[NSObject alloc] release] correct?
  • Previous by thread: Re: Function to retrieve autoresizingMask ?
  • Next by thread: Custom IB palette: Is there a way to use parent's IB inspector and also add new features to it?
  • Index(es):
    • Date
    • Thread