Ich habe gerade mein Monotouch auf 6 aktualisiert und jetzt startet meine App nicht. Es funktionierte früher ohne irgendwelche Probleme. Jetzt wird eine Ausnahme (unten aufgeführt) in der Datei Main.cs ausgelöst. Ich habe die Tipps zur Fehlerbehebung für Xamarin durchgesehen, das Problem wurde jedoch nicht behoben. Ich habe die Nib-Datei neu angeordnet, meine Steckdosen entfernt und neu konfiguriert und eine neue Feder erstellt, um zu sehen, ob das das Problem beheben würde. Hat jemand sonst irgendwelche Gedanken?Kodierung nicht kompatibel (Monotouch und iOS 6)
MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSUnknownKeyException Reason: [<UIApplication 0xc84bb10> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key btnNewAccount.
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
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
at Pokr.Application.Main (System.String[] args) [0x00000] in /Users/James/Projects/App/Main.cs:17
-Code aus der LoginView.designer.cs:
[Register ("LoginView")]
partial class LoginView
{
[Outlet]
MonoTouch.UIKit.UIImageView imgLogo { get; set; }
[Outlet]
MonoTouch.UIKit.UITextField txtEmail { get; set; }
[Outlet]
MonoTouch.UIKit.UITextField txtPassword { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton btnLogin { get; set; }
[Outlet]
MonoTouch.UIKit.UIButton btnNewAccount { get; set; }
[Outlet]
MonoTouch.UIKit.UILabel lblSecurityNotice { get; set; }
[Outlet]
MonoTouch.UIKit.UIImageView imgKeyboardBorder { get; set; }
void ReleaseDesignerOutlets()
{
if (imgLogo != null) {
imgLogo.Dispose();
imgLogo = null;
}
if (txtEmail != null) {
txtEmail.Dispose();
txtEmail = null;
}
if (txtPassword != null) {
txtPassword.Dispose();
txtPassword = null;
}
if (btnLogin != null) {
btnLogin.Dispose();
btnLogin = null;
}
if (btnNewAccount != null) {
btnNewAccount.Dispose();
btnNewAccount = null;
}
if (lblSecurityNotice != null) {
lblSecurityNotice.Dispose();
lblSecurityNotice = null;
}
if (imgKeyboardBorder != null) {
imgKeyboardBorder.Dispose();
imgKeyboardBorder = null;
}
}
-Code von Main.cs (wo die Code Pausen):
static void Main (string[] args)
{
UIApplication.Main (args, null, "AppDelegate");
}
Hier ist der Ausschnitt aus meinem AppDelegate wo Ich rufe den ViewController:
var rootNavigationController = new UINavigationController();
LoginView loginScreen = new LoginView();
rootNavigationController.PushViewController(loginScreen, false);
this.window.RootViewController = rootNavigationController;
//blank function fires so the getter will init the singleton.
Singleton.Instance.Initialize();
// make the window visible
window.MakeKeyAndVisible();
return true;
Benötigen Sie mehr Code, wenn möglich. – fuzz
Hinzugefügt Code für, es ist nur der Designer generierte Code. Aber es sollte Ihnen eine Vorstellung davon geben, was der Designer synchronisiert. Wie gesagt, es funktionierte vor dem Upgrade. Also, ich bin neugierig, ob es ein Monotouch/Entwicklung Bug ist. – jamesbar2