2012-03-23 20 views
0

我查看了與Apple的GLPaint示例相關的其他問題。也許我做錯了什麼。我得到這些警告:運行GLPaint示例的警告

Unused parameter 'touches' 
Unused parameter 'touches' 
Unused parameter 'touches' 
Unused parameter 'touches' 
Unused parameter 'event' 

Unused parameter 'motion' 
Unused parameter 'event' 
Unused parameter 'event' 
Unused parameter 'motion' 
Unused parameter 'event' 
Unused parameter 'sender' 

身在何處的一個例子,是在PaintingView.m文件,方法是:

(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 

樣品運行,但因爲我把它修改我的需要,我想了解這些意思,以及如何解決它們。

非常感謝

回答

2

警告

未使用的參數 '觸動'

表示參數touches方法中沒有使用。例如:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 
{ 
    // some code where the parameter touches is not used 
} 

最後,需要注意的是,你可以通過改變值禁用這些警告(這是默認設置),在下面的截圖強調了NO

enter image description here

+0

謝謝..他們在其他地方使用。如果我刪除它們(評論它們),我會得到錯誤。如果您確定可以重置調試參數,我會繼續。謝謝你這麼快回答。 – 2012-03-23 01:41:58

+0

個人而言,我喜歡爲未使用的值和變量提供警告,但不喜歡未使用的參數,因爲其頻繁使用的方​​法實現中不使用某些參數。 – sch 2012-03-23 01:57:21

+0

okeydoke。非常感謝! – 2012-03-23 01:58:50