I pass my string value to one method but I can't get the stored variable value. Here is my code:
NSString username = @":ram";
NSString geder = @":gender";
[twoclass newDetails:username:gender]
My method is:
NSString *twoclassname;
NSString *twoclassgender;
-(void)newDetails:(NSString *)name:(NSString *)gender{
//saved the string here;
twoclassname = name;
twoclassgender = gender;
//print name value here
NSLog(@"2classname: %@",twoclassname);
}
I get output like 2classname:ram
, I will assign this to getter method like this:
-(NSString *)getTwoclassname{
return twoclassname;
}
... when I call this getter method.like this below:
[self details:getTwoclassname];
But, console output showing null. I can't seem to get string vale "ram".
What am I doing incorrectly?