1
我有這樣的代碼:衝突的類型 ' - (布爾)validateToolbarItem:(NSToolbarItem *)theItem'
- (BOOL) validateToolbarItem:(NSToolbarItem *)theItem {
BOOL enable = NO;
if (1 == [theItem tag]) {
enable = YES;
}
return enable;
}
我得到這樣的警告,但該程序運行正常:
Conflicting types for '-(bool)validateToolbarItem:(NSToolbarItem *)theItem'
我該如何擺脫這個警告?謝謝。
在任何標題中都沒有聲明bool(小寫)。 – Vinpai 2012-02-23 08:39:34
@Vinpai你的方法validateToolbarItem在哪裏:聲明(未定義)?聲明是什麼?什麼是退貨類型? – ThomasW 2012-02-23 09:02:30
@Vinpai也是,代碼就像你輸入的一樣嗎? – ThomasW 2012-02-23 09:08:19