Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

spire.bt

macrumors newbie
Original poster
Apr 8, 2010
22
0
I really have no idea how this is done, it should be simple but i just cant get it

i have an IBAction and void and want to do this:


Code:
-(IBAction)pass{
int VariableX = 10;

[B][self getVar]; ---> send var to -(void)getVar[/B]
}


-(void)getVar{

[B]get the VariableX[/B]

if(VariableX=10){
do something
}
}
 
Sometimes code is faster than explaining!

Code:
-(IBAction)pass{
int VariableX = 10;

[self getVar:VariableX ];
}


-(void)getVar:(int) var
{

if(var=10){
do something
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.