How does this "&" work in this statement?

Posted by aquaibm on Stack Overflow See other posts from Stack Overflow or by aquaibm
Published on 2010-04-18T13:03:19Z Indexed on 2010/04/18 13:13 UTC
Read the original article Hit count: 305

Filed under:
|

I know how bitwise AND works,but I don't understand how does (sourceDragMask & NSDragOperationGeneric) work here,I don't get the point.Is there anyone can explain to me?Thanks a lot.

  • (NSDragOperation)draggingEntered:(id )sender

{

NSPasteboard *pboard;

NSDragOperation sourceDragMask;

sourceDragMask = [sender draggingSourceOperationMask];

pboard = [sender draggingPasteboard];

if ( [[pboard types] containsObject:NSColorPboardType] )
{

    if (sourceDragMask & NSDragOperationGeneric)
    {
        return NSDragOperationGeneric;
    }
}

return NSDragOperationNone;

}

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa