0

メソッドを呼び出すとき

- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view 
permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections 
animated:(BOOL)animated

UIPopoverController の、私は UIPopoverArrowDirectionUp | を渡します。allowedArrowDirections パラメータの引数としての UIPopoverArrowDirectionDown。

私の質問は簡単です:

arrowDirections で UIPopoverArrowDirectionDown の存在をテストするにはどうすればよいですか?

if (arrowDirections == UIPopoverArrowDirectionDown)
    NSLog(@"arrowDirections contains UIPopoverArrowDirectionDown");

動作しません。

4

1 に答える 1

0
if (arrowDirections & UIPopoverArrowDirectionDown == UIPopoverArrowDirectionDown) {
    NSLog(@"arrowDirections contains UIPopoverArrowDirectionDown");
}
于 2012-06-08T09:00:46.080 に答える