Executes old file

It's a realy complicated bug to explain, so I will try to update te question if somthing is not clear.

I'm making an app for ios with xamarin, a week ago, I had to change completly a view (.xib) but I did not want to lose it, so I renamed the file to SomeFile_OLD.xib, and then added a new View controller with the name SomeFile, so it created the SomeFile.xib for me.

The weird part, is that today, I needed to make a change to that file, and, form my surprise, no change where made, let's supose I changed the background color of a button to red.

After a lot of time lost, Removed all the files (the _OLD and the new) and added a new one with the same name but with the button with background red.

It worked, during half an hour, after this, when I execute the app (in a device or in the emulator) it showed the _Old file again, But I deleted it!

How can this be, and, most important, how I solve it? right now I can't change the view, because any change I make, it's not reflected upon execution ,I stil see the changes if I open again the file, so the file changes, but uppon execution, it shows me the file of a week ago...

I tryed deleting, rebooting, deleted app from device/simulator, clearing and compiling again...

out of ideas.

Tagged:

Answers

  • BertCortTorrBertCortTorr ESMember

    Solved in some way, completly unelegant and I definitly don't want it to be the definitive solution, so I will not accept this answer for the sake of finding some other better.

    I just copied the .xib file (again...) and named it SomeView_2, then in the SomeView.cs:

    public override void ViewDidLoad(){
        base.ViewDidLoad();
        var arr = NSBundle.MainBundle.LoadNib("SomeView_2", this, null);
        var vu = Runtime.GetNSObject(arr.ValueAt(0)) as UiView;
        this.View = vu;
    }
    

    as I said, this solves my issues, and I post it here in case it helps someone in the future, but I don't like it because I don't know how will this afect my Outles, to put an example.

    If I add an Outlet, in the view, will I have to add it to the other view to work? I don't like this, but, for now, it's the best that I have.

Sign In or Register to comment.