how to use value of local variable in another method?
- (void)viewDidLoad {
}
-(id)initwithinfo2:(NSInteger)pass_wordID2
{
NSLog(@"pass_wordID:%d",pass_wordID2);
}
I want to use pass开发者_运维技巧_wordID2 in viewDidLoad. How ?
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
. ;-)
精彩评论