Bug 31642 - 8.4 causes Xib errors
Summary: 8.4 causes Xib errors
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: XI 8.4.0
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-07-04 21:23 UTC by Ian
Modified: 2016-06-09 00:28 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Ian 2015-07-04 21:23:49 UTC
After upgrading to iOS 8.4 , the newest XCode and newest Xamarin, I get an error when I access any outlet from a Xib:

		[Foundation.Connect("txtHeadCir")]
		private UIDecimalField txtHeadCir {
			get {
//ERROR on this line
				this.__mt_txtHeadCir = ((UIDecimalField)(this.GetNativeField("txtHeadCir")));
				return this.__mt_txtHeadCir;
			}
			set {
				this.__mt_txtHeadCir = value;
				this.SetNativeField("txtHeadCir", value);
			}
		}
		

This error:




  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00016] in /Users/builder/data/lanes/1962/8b265d64/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:541 
  at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00095] in /Users/builder/data/lanes/1962/8b265d64/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:526 
  at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /Users/builder/data/lanes/1962/8b265d64/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:554 
  at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in /Users/builder/data/lanes/1962/8b265d64/source/mono/mcs/class/corlib/System.Reflection/ConstructorInfo.cs:62 
  at ObjCRuntime.Runtime.ConstructNSObject[NSObject] (IntPtr ptr, System.Type type, MissingCtorResolution missingCtorResolution) [0x0003e] in /Users/builder/data/lanes/1962/8b265d64/source/maccore/src/ObjCRuntime/Runtime.cs:685 
  at ObjCRuntime.Runtime.ConstructNSObject (IntPtr ptr, IntPtr klass, MissingCtorResolution missingCtorResolution) [0x00013] in /Users/builder/data/lanes/1962/8b265d64/source/maccore/src/ObjCRuntime/Runtime.cs:666 
  at ObjCRuntime.Runtime.GetNSObject (IntPtr ptr, MissingCtorResolution missingCtorResolution, Boolean evenInFinalizerQueue) [0x00022] in /Users/builder/data/lanes/1962/8b265d64/source/maccore/src/ObjCRuntime/Runtime.cs:764 
  at ObjCRuntime.Runtime.GetNSObject (IntPtr ptr) [0x00000] in /Users/builder/data/lanes/1962/8b265d64/source/maccore/src/ObjCRuntime/Runtime.cs:752 
  at Foundation.NSObject.GetNativeField (System.String name) [0x0001a] in /Users/builder/data/lanes/1962/8b265d64/source/maccore/src/Foundation/NSObject2.cs:500 
  at General.MeasurementViewController.get_txtHeadCir () [0x00008] in /Users/vink/Dropbox/Dev/iOS64/IPAD/BigChildGrowth/BigChildGrowth/MeasurementView/MeasurementViewController.xib.designer.cs:56 
  at General.MeasurementViewController.SetInitalSettings () [0x00103] in /Users/vink/Dropbox/Dev/iOS64/IPAD/BigChildGrowth/BigChildGrowth/MeasurementView/MeasurementViewController.xib.cs:153 
  at General.MeasurementViewController.ViewDidLoad () [0x000b0] in /Users/vink/Dropbox/Dev/iOS64/IPAD/BigChildGrowth/BigChildGrowth/MeasurementView/MeasurementViewController.xib.cs:61 
  at (wrapper managed-to-native) ObjCRuntime.Messaging:IntPtr_objc_msgSendSuper (intptr,intptr)
  at UIKit.UIViewController.get_View () [0x00030] in /Users/builder/data/lanes/1962/8b265d64/source/maccore/src/build/ios/native/UIKit/UIViewController.g.cs:2482 
  at General.MasterMeasurementViewController.AddViews () [0x000ca] in /Users/vink/Dropbox/Dev/iOS64/IPAD/BigChildGrowth/BigChildGrowth/MeasurementView/MasterMeasurementViewController.xib.cs:117 
  at General.MasterMeasurementViewController.ViewDidLoad () [0x00075] in /Users/vink/Dropbox/Dev/iOS64/IPAD/BigChildGrowth/BigChildGrowth/MeasurementView/MasterMeasurementViewController.xib.cs:66 
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/1962/8b265d64/source/maccore/src/UIKit/UIApplication.cs:63 
  at UIKit.UIApplication.Main (System.String[] args) [0x00000] in /Users/builder/data/lanes/1962/8b265d64/source/maccore/src/UIKit/UIApplication.cs:57 
  at General.Application.Main (System.String[] args) [0x00002] in /Users/vink/Dropbox/Dev/iOS64/IPAD/BigChildGrowth/BigChildGrowth/Main.cs:14
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-07-13 10:52:17 UTC
Could you please attach a complete test project we can use to reproduce this?
Comment 3 Rolf Bjarne Kvinge [MSFT] 2015-07-14 06:56:29 UTC
I get this when clicking on "My Records":

> Event registration is overwriting existing delegate. Either just use events or your own delegate: General.UIDecimalField+UIDecimalFieldDelegate UIKit.UITextField+_UITextFieldDelegate (System.InvalidOperationException)
>  at UIKit.UIApplication.EnsureEventAndDelegateAreNotMismatched (System.Object del, System.Type expectedType) [0x0001b] in /work/maccore/cycle5/maccore/src/UIKit/UIApplication.cs:77 
>  at UIKit.UITextField.EnsureUITextFieldDelegate () [0x0000b] in /work/maccore/cycle5/maccore/src/build/ios/native/UIKit/UITextField.g.cs:2383 
>  at UIKit.UITextField.get_ShouldReturn () [0x00000] in /work/maccore/cycle5/maccore/src/build/ios/native/UIKit/UITextField.g.cs:2508 
>  at General.UIDecimalField.Initialize () [0x00016] in /Users/rolf/Downloads/bug/Samples/MonoTouch.UICatalog/UIDecimalField.cs:33 

which is caused by this code in UIDecimalField.cs:

> Delegate = new UIDecimalFieldDelegate ();
> this.ShouldReturn += delegate {
>    this.ResignFirstResponder ();
>    return true;
> };

You're setting both the Delegate and an event (you need to remove one of them).
Comment 4 Sebastien Pouliot 2016-06-09 00:28:30 UTC
We have not received the feedback from our last comment. If you are still experiencing this issue please provide all the requested information and re-open the bug report. Thanks!