2012-04-04 60 views
0

內的某些值我有下面的代碼與bool if語句裏面和另一種方法我更改bool的值,我知道我需要回憶的方法[self someMethod];但我只是想反映在如果聲明並沒有再次回想一切,我該怎麼做?謝謝更改方法

-(void)someMethod 
{ 
    //start my code here 

    if (boolvalueisTrue)  
     { 
     //change this part only  
     } 
} 

-(void)changeBool {  
    boolvalueisTrue = TRUE;  
    [self someMethod];  
    //instead of calling the whole method i just want to reflect 
    //the changes inside my if statement   
} 

回答

1

將if語句中的代碼分解爲兩個其他方法調用的單獨方法。