Change certain values within method

Go To StackoverFlow.com

0

I have the following code with a bool if statement inside and in another method I change the value of the bool and i know i need to recall the method [self someMethod]; but I just want to reflect the changes in the if statement and not recall everything else again, how do i do this? thanks

-(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        
}
2012-04-04 05:25
by Grant Wilkinson


1

Factor the code in the if-statement into a separate method that both of those other methods call.

2012-04-04 05:28
by Chuck
Ads