Seems like I had this once and it was caused by deleting entries in the 
designer.cs file for a viewController class.  Suggest opening your xib or 
designer.cs files and looking for the 'mainNavigation' tag and deleting those 
entries.


-----Original Message-----
From: [email protected] on behalf of Wally McClure
Sent: Tue 6/19/2012 2:20 PM
To: [email protected]
Subject: [MonoTouch] build for device or adhoc problem
 

I've been working on an iPhone/iPad Universal app.  Everything works fine in 
the simulator.  Unfortunately, I'm getting all different types of failure 
errors when I attempt to run on the device this afternoon.  I have not 
previously seen these errors when I have tested on the device.  I have created 
an adhoc certificate and installed it on my dev machine.  Everything compiles 
properly.  Unfortunately, I end up with a log entry in the crash log that looks 
like this:
http://pastebin.com/yc4T6Crk  (Yeah, I won't bore you by pasting the log in 
here)

When I go to debug mode and attempt to test on the device, MonoDevelop pops up 
with the following error:
MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown.  Name: 
NSUnknownKeyException Reason: [<UIApplication 0x1666400> 
setValue:forUndefinedKey:]: this class is not key value coding-compliant for 
the key mainNavigation.
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String 
principalClassName, System.String delegateClassName) [0x00042] in 
/Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29
  at BoyScoutApplications.Application.Main (System.String[] args) [0x00000] in 
/Users/wallym/SkyDrive/Documents/ScoutingIsForLife/BoyScoutApplications/Main.cs:17

I've set breakpoints at the start of my code in the app as well as in the 
FinishedLaunching event and my code never seems to get hit.  I don't have any 
code in the Main.cs file that I have added.  

My finished launching method looks like this:

    [Register ("AppDelegate")]
    public partial class AppDelegate : UIApplicationDelegate
    {
        // class-level declarations
        UIWindow window;
        BoyScoutApplicationsViewController viewController;
        UINavigationController rootNavigationController; 
        
        //
        // This method is invoked when the application has loaded and is ready 
to run. In this 
        // method you should instantiate the window, load the UI into it and 
then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will 
terminate your application.
        //
        public override bool FinishedLaunching (UIApplication app, NSDictionary 
options)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);
            rootNavigationController = new UINavigationController(); 
            this.window.RootViewController = this.rootNavigationController; 

            viewController = new BoyScoutApplicationsViewController ();
            
            this.rootNavigationController.PushViewController(viewController, 
false); 
            //window.RootViewController = viewController;
            window.MakeKeyAndVisible ();
            
            return true;
        }
    }

Any ideas for something dumb that I have done are appreciated.

Wally 


                                          

_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to