Re: Function to retrieve autoresizingMask ?
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