Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin - After updating Xcode and reinstalling Xamarin I get multiple NSUnknownKeyException errors

Tags:

xcode

ios

xamarin

I am developing with Xamarin 4.0.13 and since upgrading from a much earlier version of Xcode to Xcode 4.6.3 I am now receiving errors when I try to build to either the device or the iOS simulator. I had to reinstall Xamarin.iOS after updating Xcode because Xamarin said iOS was not installed.

The errors are to do with linking the single xib file I believe. The error comes up referring to the below code inside Main.cs

UIApplication.Main (args, null, "AppDelegate");

It states;

"Objective-C exception thrown. Name: NSUnknownKeyException Reason: [ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key LoginBtn."

I looked into the same error log at the links below but I believe I have a different problem because if I remove the LoginBtn from the xib file it then changes to complain about the usernameTextInput Outlet, and so on until no outlets are left. After removing everything from the xib file so that it's completely empty (except for the parent view object), it has the same error log but instead of LoginBtn it complains about "view". I have tried reapplying the link from the View object to the File's Owner but that hasn't changed anything.

Similar error log answers that haven't solved it: this class is not key value coding-compliant for the key authView, What does this mean? "'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X"

I have cleaned all from within Xamarin's Build dropdown box at the top and I don't even know how to get a blank page showing up from my document after deleting everything in the view.

It's a single page application with no other xib files and is in the very early stages.

Any light you can shed on this would be much appreciated.

Thanks, Jason.

like image 436
ThinkOutside Avatar asked Oct 16 '13 14:10

ThinkOutside


1 Answers

I came across a similar problem several days ago when I added a new outlet to a UIView. I removed the outlet and cleaned everything up and then reconnected the outlet. Finally, after a day I noticed that the outlet had also placed a release in the dealloc method in Objective-C. Looking at my other views I noticed there were not dealloc methods being called. Once I removed it and did a clean build the error went away from Xamarin Studio.

like image 80
JamWils Avatar answered Oct 12 '22 05:10

JamWils