Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 20th, 2012  |  syntax: None  |  size: 1.52 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. App method, when in wireless mode ok, when in GSM Network freeze
  2. [NSTimer scheduledTimerWithTimeInterval:(25) target:self selector:@selector(getInitialData:) userInfo:nil repeats:YES];
  3.        
  4. - (void) getInitialData:(id)obj{
  5. NSAutoreleasePool *initpool=[[NSAutoreleasePool alloc]init];
  6. //Check if the simulation mode is set
  7. if ([getSimulationMode getMode]) {
  8.     //Load simulation-values into the plistĀ“s
  9.     [myStockView.loadindicator stopAnimating];
  10.     [Koehl_WMSAppDelegate loadSimulationData];
  11. }else{
  12.     [myStockView.loadindicator startAnimating];
  13.     //Variables to check internet connection
  14.     Reachability* reachability = [Reachability reachabilityWithHostName:@"www.google.de"];
  15.     NetworkStatus remoteHostStatus = [reachability currentReachabilityStatus];
  16.  
  17.     if(remoteHostStatus == NotReachable) {
  18.         UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"No internet connection available!"
  19.                                                        delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil ];
  20.         [alert show];
  21.         [alert release];
  22.     }
  23.     else {
  24.         [loadStockData loadData];
  25.         [loadArticleData loadData];
  26.         [loadAlarmData loadData];
  27.         [loadProductData loadData];        
  28.     }
  29.     [myStockView.loadindicator stopAnimating];
  30.  
  31. }
  32. //After all new Data got loaded, the views can be refreshed
  33.  
  34. [myStockView loadStockData];
  35. [initpool release];
  36.  
  37.  }
  38.        
  39. ...
  40. XMLRPCResponse *userInfoResponse=[XMLRPCConnection sendSynchronousXMLRPCRequest:request error:error2];
  41. ...