2010-06-26 67 views
1

我有一個方法,像這樣傳遞價值的方法是始終爲零

-(void) reDrawPreviewWith:(UIColor *)textColor withGlowColor:(UIColor *)glowColor withGlowIntensity:(float)glowIntensity 

我調用此方法的UIView的子類,由

float glowIntensity = 30.0f; 
[preview reDrawPreviewWith:[UIColor colorWithRed:red green:green blue:blue alpha:1.0] 
          withGlowColor:[UIColor colorWithRed:red green:green blue:blue alpha:1.0] 
         withGlowIntensity:glowIntensity]; 

但裏面reDrawPreviewWith的身體,我總是讓glowIntensity = 0

+0

你嘗試把30.0f直接進入參數?這聽起來沒有什麼錯我 – vodkhang 2010-06-26 06:59:49

+3

你如何確定'glowIntensity' = 0? – diederikh 2010-06-26 08:10:00

+0

vodkhang:是的,我也試圖與30.0f直接進入參數,它不工作 – coure2011 2010-06-26 19:21:17

回答

1

我試着用調試器來測試你的代碼,它似乎正確地傳遞glowIntensity參數。你肯定沒有其他地方reDrawPreviewWith:被調用的地方嗎?也許以一種錯誤的方式?