Guest User

Untitled

a guest
Jan 16th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  2. {
  3. // Override point for customization after application launch.
  4. // Add the tab bar controller's current view as a subview of the window
  5. application.applicationSupportsShakeToEdit = YES;
  6.  
  7.  
  8. [[self.tabBarController.tabBar.items objectAtIndex:0] setTitle:[Util getLangValueForTag:@"menufleet"]];
  9. [[self.tabBarController.tabBar.items objectAtIndex:1] setTitle:[Util getLangValueForTag:@"menuevent"]];
  10. [[self.tabBarController.tabBar.items objectAtIndex:2] setTitle:[Util getLangValueForTag:@"menusettings"]];
  11.  
  12.  
  13. if(![Util openConfigurationFile])
  14. {
  15.  
  16. NSString* noFileMessage = @"Welcome to iEvo Fleet.nYou'll be now redirected to the settings area to provide your Evolution account information.";
  17. UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome" message:noFileMessage delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
  18. [alert show];
  19. [alert release];
  20.  
  21. }
  22. else
  23. {
  24. LoginWS* service = [LoginWS service];
  25. [service Login:self action:@selector(LoginHandler:) username:[Util getConfigLoginName] password:[Util getConfigLoginPassword]];
  26. }
  27.  
  28. [self.window makeKeyAndVisible];
  29.  
  30. return YES;
  31. }
  32.  
  33. - (void)alertView:(UIAlertView *)alertView willDismissWithButtonIndex:(NSInteger)buttonIndex
  34. {
  35. if([alertView.title isEqualToString:@"File error"] ||
  36. [alertView.title isEqualToString:@"Login error"] ||
  37. [alertView.title isEqualToString:@"Welcome"])
  38. {
  39. if(buttonIndex == 0)
  40. {
  41. [self.tabBarController setSelectedIndex:2];
  42. self.window.rootViewController = self.tabBarController;
  43. }
  44. }
  45. }
Add Comment
Please, Sign In to add comment