tags:

views:

26

answers:

1
- (void)viewDidLoad {


}

-(id)initwithinfo2:(NSInteger)pass_wordID2
{
    NSLog(@"pass_wordID:%d",pass_wordID2);


}

I want to use pass_wordID2 in viewDidLoad. How ?

+2  A: 

Make an Instance Varibale in the *.h file. Than do it like this in initWithInfo2:

yourInstanceVariable = pass_wordID2;

Than you can use yourInstanceVariable in viewDidLoad. ;-)

Sandro Meier
myInstanceVariable get reset to 0. I am not able to get value of it.
Dhaval
if you use your initwithinfo2 method to initialize your instance, than you have to change the following to your method:if(self = [super init]) { yourInstanceVariable = pass_wordID2;}than it should work...
Sandro Meier