我有一個按鈕來改變BOOL
showSquare
等於YES
爲什麼這個if語句不起作用?
這是按鈕
- (IBAction)Tap_Square:(id)sender {
[graphicsView setNeedsDisplay];
[graphicsView setShowSquare:YES];
}
的代碼,這就是if語句
if (showSquare) {
CGContextSetFillColorWithColor(context, white);
CGContextFillRect(context, CGRectMake(90, 90, 100, 100));
}
我在幹嘛有問題?
感謝
你的財產在哪裏申報? – DrummerB 2012-08-16 01:49:32
確保'showSquare'爲YES,並在'[graphicsView setShowSquare:YES]'上設置斷點以確保它被執行 – 2012-08-16 01:49:38
嘗試將yes更改爲true? – alpera 2012-08-16 01:51:14