IPhone : how to retrieve Nsstring value from Nsobject?

on Monday, February 23, 2015

i have small doubt in retrieve value from Nsobject class.Firstly i handling login check condition, when i press login button i get response from web service in Nslog, in that i have to capture a string called LoginStatus wether its success r failure.i created NSObject class and its contains one one String,my NSObject class name response_value



@property (nonatomic, retain)NSString *Loginstatus;


now in web service class:



response.Loginstatus =[[[json valueForKey:@"login_response"]valueForKey:@"status"]objectAtIndex:0];

NsLog (@"%@",response.Loginstatus);


my requested string values are stored in response.LoginStatus string successfully.


But my actual problem is stating in my Login ViewController


i set an condition to check login status if login success means i need to show alert msg either for success r for failure



response_value *response = [[response_value alloc]init];
if ([response.response.Loginstatus isEqualToString:@"Login Successfull"]) {
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Success" message:response.loginStatusString delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
}


but this condition never getting called and i also checked wether the NSObject string holds any values but the values are null in Nslog


can someone fix my problem


0 comments:

Post a Comment