Właśnie zaktualizowałem Monotouch do wersji 6, a teraz moja aplikacja się nie uruchomi. To działało poprzednio bez żadnych problemów. Teraz zgłasza wyjątek (wymieniony poniżej) w pliku Main.cs. Przejrzałem wskazówki dotyczące rozwiązywania problemów dotyczące Xamarin, ale to nie rozwiązało problemu. Ponownie przygotowałem plik nib, usunąłem i zrekonfigurowałem moje sklepy, i utworzyłem zupełnie nowego stalówka, aby sprawdzić, czy to rozwiąże problem. Czy ktokolwiek ma jakieś myśli?Zgodność z kluczem niezgodnym z kluczem (Monotouch i 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
kod z 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;
}
}
Kod z Main.cs (gdzie podziały kodu):
static void Main (string[] args)
{
UIApplication.Main (args, null, "AppDelegate");
}
Oto urywek z mojego AppDelegate gdzie Zadzwoń do 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;
Potrzebujesz więcej kodu, jeśli to możliwe. – fuzz
Dodano kod, jest to tylko wygenerowany przez projektanta kod. Powinien jednak dać ci wyobrażenie o tym, co projektant synchronizuje. Jak już powiedziałem, działało to przed aktualizacją. Więc jestem ciekawy, czy to błąd Monotouch/develop. – jamesbar2