Xamarin Studio won't sync with XCode 4.6.2- How do I fix it?

This week XCode asked me if I wanted to upgrade to version 4.6.2, and I naively okayed it. After the update had installed, Xamarin could no longer pick up the outlet code from my screen's .h file and generate corresponding code in the screen's .designer.cs file.

Allie from Xamarin told me to update to Xamarin.iOS 6.2.4.2. It didn't work.

She then sent me a link to Xamarin.iOS 6.3.5.43. That didn't fix the problem either.

I then tried reverting to XCode 4.6.1. That didn't work.

I then tried reverting to XCode 4.6. That didn't work.

I have tried putting in the required code in the designer.cs files by hand, but if there is one little mismatch between the .h and the designer.cs file, Xamarin removes all the hand-edited code from the designer.cs as if the .h file contained no outlets.

It's the weekend now and Allie is not there.

Any help would be much appreciated!

Best Answer

Answers

  • RossBalmerRossBalmer USMember
    edited May 2013

    I have discovered something else which seems like it might be relevant.

    In XCode, when I ctrl-drag to make an outlet it writes something like this in the .h file:

    IBOutlet UIButton *btnTest;

    I have noticed that later on this gets changed to

    UIButton *_btnTest;

    and a property is added at the bottom of the .h file, e.g.:

    @property (nonatomic, retain) IBOutlet UIButton *btnTest;

    and a synthesise is added to the .m file

    @synthesize btnTest = _btnTest;

    What I surmise is happening is that the outlet code, initially written to the .h file by XCode when I ctrl-drag, is rewritten by Xamarin.iOS, which adds the property and synthesize statements and then uses those to generate the designer.cs file.

    It seems a lot like Xamarin.iOS is not rewriting the .h and .m files as it needs to, and hence cannot generate the designer.cs file properly.

    I may be wrong, so can anyone confirm this?

    Either way, what can I do about it?

    I have tried using older and older versions of Xcode all the way back to 4.4.

    thanks
    Ross Balmer

  • mhutchmhutch USMember, Xamarin Team Xamurai
    edited May 2013

    This would be one for @jstedfast but he's not around this week. Could you please file a bug with repro steps?

    Whether the outlets use fields or properties shouldn't matter. Xcode handles both - which it generates depends where in the file you control-drag.

  • JacquesJacquesJacquesJacques ZAMember ✭✭

    I'm having the same issue, it used to work, but now all of a sudden it doesn't.

  • JacquesJacquesJacquesJacques ZAMember ✭✭

    Any feedback yet ?

  • mhutchmhutch USMember, Xamarin Team Xamurai

    I can repro the issue with drag-creating ivars (fields) and there is a bug file, I suggest you use properties for now. Just control-drag to where the properties would be defined and Xcode will create a property.

  • JeffreyStedfastJeffreyStedfast USXamarin Team Xamurai

    fixed in git master

  • tbergerontbergeron CAMember
    edited June 2013

    How is this fixed? I have the same problem with the latest versions of "everything" (osx, xcode, xamarin, etc).

    Also it always removes my other #imports.

    For example I need to add this: #import <WebKit/WebKit.h>

    And everytime it gets removed.

    Last point, when I create a new outlet for a button for example most of the time after it says "syncing with xcode" it doesn't work even if I see the reference in the .designer.cs file.

    Any idea? Please help me?

    Thanks!

  • Hi there
    upgraded to version 4.6.3, and Xamarin Studio won't sync. Can you help me?

  • RossBalmerRossBalmer USMember

    I deleted everything, switched to the alpha channel, reinstall and voila!

  • didn't work...did you delete xamarin, Xcode and then re-install Xcode and after xamarin? reboot?

  • re-install xcode 4.6.1 and xamarin 4.0.8 and nothing!! won't sync!!!!

  • JeffreyStedfastJeffreyStedfast USXamarin Team Xamurai

    Hi Rui,

    You need to install Xamarin Studio 4.0.9 from the Beta channel (you can uncheck the other beta packages so that you keep stable packages of everything else)

  • AlexPalmaAlexPalma USMember ✭✭

    Just to confirm Xamarin.iOS 6.3.6 does this support xcode 4.6.3?
    Just don't want to download a +1GB update to then have to revert to a previous version.

  • JeffreyStedfastJeffreyStedfast USXamarin Team Xamurai

    @AlexandrePalma

    Yes.

    Support for Xcode >= 4.6.1 was only an issue back in May with Xamarin Studio 4.0.3 (or was it 4.0.4?) and has long been fixed.

    I don't think there was ever an issue with Xamarin.iOS, but if there was, it's been long fixed as well. Any current release on any of the Stable, Beta or Alpha channels will work fine with Xcode >= 4.6.1.

    Hope that clears up any confusion.

  • AlexPalmaAlexPalma USMember ✭✭

    Thanks, just wanted to make sure before updating xcode.

Sign In or Register to comment.