Bug 14508 - Apps created with the latest alpha ignore events
Summary: Apps created with the latest alpha ignore events
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 4.1.10
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: master
Assignee: Mike Krüger
URL:
: 14513 ()
Depends on:
Blocks:
 
Reported: 2013-09-06 18:25 UTC by Paul Johnson
Modified: 2013-09-09 13:26 UTC (History)
5 users (show)

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


Attachments
Simple example showing the problem (18.86 KB, application/zip)
2013-09-06 18:25 UTC, Paul Johnson
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 FIXED

Description Paul Johnson 2013-09-06 18:25:52 UTC
Created attachment 4800 [details]
Simple example showing the problem

I have created a very simple app that is ignoring the TouchUpInside event from a UIButton, intact, it's ignoring everything after putting the view onto the simulator. I've not tested this on a real device yet, so it could be an AOT/JIT issue.

When I look at the errors, I am seeing that the ShouldRotate needs [Obsolete] before the method, but as you can see from the attached example, that method has gone.

I originally thought it was the BackgroundWorker, but removing it and there are no changes. If I set a debug point for every line in the view controller, none of them are hit. The app doesn't die though.

Using XS 4.1.10
Comment 1 Jeffrey Stedfast 2013-09-06 18:35:52 UTC
This is a Xamarin.iOS bug (Xamarin Studio is just the IDE for future reference).

What version of Xamarin.iOS are you using?
Comment 2 Sebastien Pouliot 2013-09-06 19:00:45 UTC
There's no user code in your attachment. It looks like a non-customized template, one XIB and 3 outlets.
Comment 3 Paul Johnson 2013-09-06 19:54:07 UTC
That part is a definite bug in xam.studio - it's not saving code.

The code for the controller is this

using System;
using System.Drawing;
using System.ComponentModel;
using System.Timers;
using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace backgroundworker
{
    public partial class backgroundworkerViewController : UIViewController
    {
        public backgroundworkerViewController() : base ("backgroundworkerViewController", null)
        {
        }

        public override void DidReceiveMemoryWarning()
        {
            // Releases the view if it doesn't have a superview.
            base.DidReceiveMemoryWarning();
            
            // Release any cached data, images, etc that aren't in use.
        }

        private UIImage downloadedImage;
        private BackgroundWorker bgWorker;
        private Timer t;
        private int counter = 0;

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            bgWorker = new BackgroundWorker();
            bgWorker.DoWork += HandleDoWork;
            bgWorker.RunWorkerCompleted += HandleRunWorkerCompleted;
            btnStart.TouchUpInside += delegate
            {
                t = new Timer(100);
                t.Elapsed += delegate
                {
                    counter++;
                    lblCountValue.Text = counter.ToString();
                };
                t.Start();
                bgWorker.RunWorkerAsync();
            };
        }

        private void HandleRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            uiImageView.Image = UIImage.FromImage(downloadedImage.CGImage).Scale(new SizeF(240f, 240f));
            t.Stop();
        }

        private void HandleDoWork(object sender, DoWorkEventArgs e)
        {
            NSUrl url = new NSUrl("http://edmullen.net/test/rc.jpg");
            NSData data = NSData.FromUrl(url);
            downloadedImage = new UIImage(data);
        }
    }
}

I'm using xam.ios 6.4.4.12 (Business Edition) - it was not causing an issue prior to updating xam.studio, so I'm wondering if the not saving code has something to do with the events not showing.
Comment 4 Paul Johnson 2013-09-06 19:58:36 UTC
@Jeff - I'm well aware that xam.studio is the IDE, I've been playing this game for long enough now...
Comment 5 Paul Johnson 2013-09-07 10:06:40 UTC
Ok, went back a step to test if it is xam.studio by installing the version on the beta channel (4.0.12). All of the issues I've reported here (code not updating etc) are working fine. Looks like the current XS is borked.
Comment 6 Jeffrey Stedfast 2013-09-07 10:20:48 UTC
I reassigned this to Xamarin.iOS because your explanation of the bug made it sound like the issue was that the compiled program isn't receiving TouchUpInside events.

Did I misunderstand the issue? I'm confused.
Comment 7 Paul Johnson 2013-09-07 10:42:38 UTC
The bug was never a Xam.iOS one, but always Xam Studio. Had there been an update to Xam.iOS at the same time as Xam.Studio, then it could have been either/or.

I know this as the code had been created before the update and it worked. After the update of Xam Studio, it didn't. When I tested the code further, none of the breakpoint I had inserted were being hit, the code wasn't saving, nor was it updating from Xcode.

Reverting back to the previous Xam Studio and everything works again.

I'm sorry of this has caused you any confusion, but it is a xam.studio issue.
Comment 8 Sebastien Pouliot 2013-09-08 10:32:05 UTC
Sounds like the files are not saved (at all, or not before building)
Comment 9 Paul Johnson 2013-09-08 11:42:08 UTC
It goes under at all and occasionally  reverts back to previous versions of the code :(
Comment 10 Jeffrey Stedfast 2013-09-08 13:25:38 UTC
I need a better explanation of EXACTLY what is going wrong because right now it's all vague and confusing.

The Xcode sync code hasn't changed in months, so it's got nothing to do with that.


As far as I know, the only changes in the new alpha (4.1.10) from the previous alpha were ALL in the iOS Designer code which *replaces* the need to sync with Xcode.
Comment 11 Jeffrey Stedfast 2013-09-08 17:13:16 UTC
Based on your comments on the forum, it sounds like a Xamarin Studio text editor bug in that it isn't saving your files.

That's what all of the other bugs that you are hitting seem to be related to.
Comment 12 Mike Krüger 2013-09-09 01:15:52 UTC
The bug is fixed - but I doubt that we'll take it for 4.0.13 - but I suppose it'll work in the version after.
Comment 13 Paul Johnson 2013-09-09 04:34:28 UTC
Given that as the save is not happening which is needed before the build occurs that releasing 4.0.13 without it in won't be of much use. Would it not be a better idea to delay 4.0.13 / 4.1.11 (the bug doesn't show in 4.0.12) to ensure it goes in?
Comment 14 Paul Johnson 2013-09-09 05:00:09 UTC
For the Xcode sync issue, it's simple. Create a UI, connect it up and the code changes from the connector are reflected fine (they can be seen in the designer.cs file). Alter the xib file again, save and the new changes don't show.
Comment 15 Jeffrey Stedfast 2013-09-09 10:32:52 UTC
*** Bug 14513 has been marked as a duplicate of this bug. ***
Comment 16 Saurabh 2013-09-09 13:26:51 UTC
I am not able to reproduce this issue with steps mentioned in comment 14.

I have followed following steps:
1.Created an iOS Single View application in XS.
2.Open an .xib file in Xcode and added any control to it (for e.g button)
3.Add action to added control.
4.Copy method from designer..cs and paste into .cs file.
5.Run the application on device/simulator .

Result:I am able to see the control added to the application successfully.

Now again stop the application and alter .xib file by adding some controls into it.
Again add action for newly added control.
Repeat step 4 by copying method from designer..cs and paste into .cs file.
Again run the application.

Result: On running the application I am able to see the newly added controls also.

XS 4.1.10
Xcode 4.5/ 4.6.3
MT Version: 6.9.7.186
Mono 3.2.2 ((no/a0fc6ba)