/Mobile/iPhone/StoffiRemote/StoffiRemote/LoginViewController.m

http://yet-another-music-application.googlecode.com/ · Objective C · 70 lines · 40 code · 14 blank · 16 comment · 2 complexity · f17f9cc892f57f65e1facfdc688377a0 MD5 · raw file

  1. //
  2. // LoginViewController.m
  3. // StoffiRemote
  4. //
  5. // Created by Fredrik Gadnell on 9/26/11.
  6. // Copyright 2011 __MyCompanyName__. All rights reserved.
  7. //
  8. #import "LoginViewController.h"
  9. #import "User.h"
  10. @implementation LoginViewController
  11. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  12. {
  13. self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
  14. if (self) {
  15. // Custom initialization
  16. }
  17. return self;
  18. }
  19. - (void)loginPressed {
  20. // Simulation
  21. // [[StoffiOAuthManager sharedManager] signInToStoffiWithDelegate:self];
  22. [self didLogin];
  23. NSLog(@"Logged in as local simulated user");
  24. }
  25. - (void)didLogin {
  26. [self dismissModalViewControllerAnimated:YES];
  27. [[User currentUser] pullConfiguration];
  28. }
  29. - (void)dealloc
  30. {
  31. [super dealloc];
  32. }
  33. - (void)didReceiveMemoryWarning
  34. {
  35. // Releases the view if it doesn't have a superview.
  36. [super didReceiveMemoryWarning];
  37. // Release any cached data, images, etc that aren't in use.
  38. }
  39. #pragma mark - View lifecycle
  40. - (void)viewDidLoad
  41. {
  42. [super viewDidLoad];
  43. // Do any additional setup after loading the view from its nib.
  44. }
  45. - (void)viewDidUnload
  46. {
  47. [super viewDidUnload];
  48. // Release any retained subviews of the main view.
  49. // e.g. self.myOutlet = nil;
  50. }
  51. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
  52. {
  53. // Return YES for supported orientations
  54. return (interfaceOrientation == UIInterfaceOrientationPortrait);
  55. }
  56. @end