Advertisement
Guest User

Untitled

a guest
Jul 14th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. - (void) viewDidLoad
  2. {
  3. responseData = [NSMutableData new];
  4. NSString *url = @"http://gensure.in/google/sys/FormToken.ashx";
  5.  
  6. NSString *strParameter = [NSString stringWithFormat:@"user=%@&password=%@", @"admin",@"pass"];
  7. NSString *strResponse = [self httpSync:@"POST":url :strParameter];
  8. RDataParser *rDParse = [[RDataParser alloc]initWithClass:nil :[strResponse dataUsingEncoding:NSUTF8StringEncoding] :false];
  9. if ([rDParse.arrElementData count]>0){
  10.  
  11. // [RSession setSessionForBool:false :@"isloggedin"];
  12. // UIWindow *window=[UIApplication sharedApplication].keyWindow;
  13. // UIViewController *root = [window rootViewController];
  14.  
  15. // UIStoryboard *storyboard=[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"RLoginVC"];
  16.  
  17.  
  18. [RSession setSession:[rDParse.arrElementData objectAtIndex:0] :@"tokenDetails"];
  19. NSLog(@"Token:%@",[rDParse.arrElementData objectAtIndex:0]);
  20.  
  21.  
  22. NSString *str_url = @"http://gensure.in/google/sys/formsql.ashx?sqlkey=430cfb3f-2936-4927-b37d-82dc149b9cfd&p1=&p2=";
  23. str_url =[NSString stringWithFormat:@"%@&token=%@",str_url,[self getToken]];
  24. // NSURL *url = [NSURL URLWithString:str_url];
  25. NSString *str_Response = [self getDataFrom:str_url];
  26. str_Response = str_Response;
  27.  
  28.  
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement