Bug 3538 - DialogViewController RefreshRequested causes crash
Summary: DialogViewController RefreshRequested causes crash
Status: RESOLVED DUPLICATE of bug 325
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 5.2
Hardware: Other Other
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-02-19 16:58 UTC by Luxyluxe
Modified: 2012-02-20 16:57 UTC (History)
2 users (show)

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


Attachments
the crash log... (9.01 KB, application/octet-stream)
2012-02-19 16:58 UTC, Luxyluxe
Details


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 DUPLICATE of bug 325

Description Luxyluxe 2012-02-19 16:58:18 UTC
Created attachment 1389 [details]
the crash log...

Hello,

Nasty crash happens when a DialogViewController contains an EntryElement
and RefreshRequested handler is set (see code below).
Run this on simulator, debug mode, and type some random text (containing spaces) in the EntryElement. Crash will follow.


namespace MyApp
{
	// The UIApplicationDelegate for the application. This class is responsible for launching the 
	// User Interface of the application, as well as listening (and optionally responding) to 
	// application events from iOS.
	[Register ("AppDelegate")]
	public partial class AppDelegate : UIApplicationDelegate
	{
		// class-level declarations
		UIWindow window;
		UINavigationController navController;
		DialogViewController dv ;

		//
		// 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)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			navController = new UINavigationController();
			var root = new RootElement("Test") {
				new Section("Type some text") {
					new EntryElement("that contains spaces", string.Empty, string.Empty)
				}
			};
			
			dv = new DialogViewController(root, true);
			dv.RefreshRequested += HandleDvRefreshRequested;
			navController.PushViewController(dv, true);
			// If you have defined a view, add it here:
			// window.AddSubview (navigationController.View);
			
			// make the window visible
			window.MakeKeyAndVisible ();
			
			
			//On iOS5 we use the new window.RootViewController, on older versions, we add the subview
            if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0)) {
				window.RootViewController = navController;
			} else {
				window.AddSubview (navController.View);
			}
			
			return true;
		}

		void HandleDvRefreshRequested (object sender, EventArgs e)
		{
			
		}
	}
}
Comment 1 Sebastien Pouliot 2012-02-20 15:05:14 UTC
I do not get the crash, but I do get hangs (with a 100% CPU usage), with the above code.

Is it possible that the (attached) crash log comes from another application ? in that case I believe it crashed a long way from where the issue is located (otherwise it's hard to imagine how the stack could look like this).
Comment 2 Sebastien Pouliot 2012-02-20 15:50:52 UTC
Autocorrect iOS simulator dupe.
Full answer at http://stackoverflow.com/q/9357098/220643

*** This bug has been marked as a duplicate of bug 325 ***
Comment 3 Luxyluxe 2012-02-20 16:57:18 UTC
Thanks for your time, thanks for great support, thanks for great product.