Guest User

Untitled

a guest
Jun 20th, 2012
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  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. ...
Advertisement
Add Comment
Please, Sign In to add comment