Guest User

Untitled

a guest
Jan 16th, 2013
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.54 KB | None | 0 0
  1. MonoTouch.Foundation.MonoTouchException has been thrown:
  2.  
  3. Objective-C exception thrown. Name: NSUnknownKeyException Reason: [<UIApplication 0xc82d330> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tabBarController.
  4.  
  5. MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSUnknownKeyException Reason: [<UIApplication 0xc82d330> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tabBarController.
  6. at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  7. at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0004c] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:38
  8. at Test.Application.Main (System.String[] args) [0x00000] in /Users/merqurio/Projects/Test/Test/Main.cs:17
  9.  
  10. -(id)init {
  11.  
  12. self = [super init];
  13. if (self) {
  14.  
  15.  
  16. HomePageViewController *homePageViewController = [[HomePageViewController alloc]initWithNibName:@"HomePageViewController" bundle:nil];
  17. WorkoutOfTheDayViewController *workoutOfTheDayViewController = [[WorkoutOfTheDayViewController alloc]initWithNibName:@"WorkoutOfTheDayViewController" bundle:nil];
  18. ScheduleViewController *scheduleViewController = [[ScheduleViewController alloc]initWithNibName:@"ScheduleViewController" bundle:nil];
  19. TrackingViewController *trackingViewController = [[TrackingViewController alloc]initWithNibName:@"TrackingViewController" bundle:nil];
  20.  
  21. UINavigationController *navHome = [[UINavigationController alloc]initWithRootViewController:homePageViewController];
  22. UINavigationController *navWorkOut = [[UINavigationController alloc]initWithRootViewController:workoutOfTheDayViewController];
  23. UINavigationController *navSchedule = [[UINavigationController alloc]initWithRootViewController:scheduleViewController];
  24. UINavigationController *navTrack = [[UINavigationController alloc]initWithRootViewController:trackingViewController];
  25.  
  26. homePageViewController.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"Home" image:[UIImage imageNamed:@"home.png"] tag:0];
  27. workoutOfTheDayViewController.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"Log WOD" image:[UIImage imageNamed:@"wod.png"] tag:1];
  28. scheduleViewController.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"Schedule" image:[UIImage imageNamed:@"schedule.png"] tag:2];
  29. trackingViewController.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"Tracking" image:[UIImage imageNamed:@"tracking.png"] tag:3];
  30.  
  31.  
  32. self.viewControllers = [NSArray arrayWithObjects:navHome,navWorkOut,navSchedule,navTrack, nil];
  33.  
  34. }
  35. return self;
  36. }
  37.  
  38. self.window.rootViewController = [[MainTabBarController alloc]init];
  39.  
  40. public override bool FinishedLaunching(UIApplication app, NSDictionary options)
  41. {
  42. _mainWindow = new UIWindow(UIScreen.MainScreen.Bounds);
  43. _mainTabBarController = new MainTabBarController();
  44. _mainWindow.AddSubview(_mainTabBarController.View);
  45. _mainWindow.MakeKeyAndVisible ();
  46. window.RootViewController = _mainTabBarController.View;
  47. return true;
  48. }
  49.  
  50. public class MainTabBarController : UITabBarController
  51. {
  52. public override void ViewDidLoad ()
  53. {
  54. ViewControllers = new UIViewController[]
  55. {
  56. new ViewControllerTab1(),
  57. new ViewControllerTab2(),
  58. new ViewControllerTab3(),
  59. new ViewControllerTab4(),
  60. new ViewControllerTab5()
  61. };
  62.  
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment