Failed to connect (MYAction) outlet from (MYController) to (NSButton): missing setter

NinineaNininea USUniversity ✭✭✭

Failed to connect (MYAction) outlet from (MYController) to (NSButton): missing setter

After today's update I got this kind of messages for many items :( I have checked in xcode and is show that outlets are connected. But when I try remove and reconnect again, it seems my designer file is not updated in xamarin studio :/

Answers

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    Hmm. Xcode integration could be buggy.

    • What xcode are you using?
    • Have you tried reopening the storyboard, save, quit, and swapping back to XS?
    • Have you tried a full clean/build?
  • NinineaNininea USUniversity ✭✭✭

    xcode - Version 7.3.1
    I tried several times both steps
    :(

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    Hmm. Let's get more information:

    • Launch XS, open your storyboard, make a change, save and quit xcode. And then find the latest IDE log at:
      Help -> Open Log Directory and find the newest IDE.* log. Upload it somewhere / pastebin / gist it. Maybe the integration code is crashing/throwing?
  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    Also, if the project reproducing this behavior is self contained and sharable, that would be even more useful.

    In addition, have you checked the relevant designer.cs file in your project to see if it's referencing non-existant things. If you manually edit it to remove those, do things work? If you reopen your storyboard, edit, save, and quit, do your manual changes revert?

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    In the end, we're just converting the objective-c header to the C# designer, so you need to make sure your header file in xcode matches your storyboard UI.

  • JeffreyStedfastJeffreyStedfast USXamarin Team Xamurai

    Most likely your storyboard is out of sync with the exported Objective-C .h or .m file (wherever you are dragging & dropping your outlet connections in Xcode).

    This can happen if you delete an outlet by manually editing the .h or .m file but forget to disconnect the outlet in the storyboard editor.

    Last time I played with Xcode's storyboard editor, this was not a straight-forward process and it was very easy to get confused. Hopefully someone who knows what they are doing in Xcode's UI designer can chime in and help steer you in the right direction. Sadly, this is beyond my ability.

    Maybe someone like @CraigDunn knows how to do this?

  • KMullinsKMullins USMember, Xamarin Team Xamurai
    edited October 2016

    All,

    I have tested this on a few different Xamarin.Mac projects and I am unable to reproduce the issue. I would suggest trying the following:

    1. Quit Xamarin Studio (if it is already running).
    2. Delete the bin and obj files from the project.
    3. Start Xamarin Studio, open the project and attempt to edit the storyboard in Xcode again.
    4. Save your changes.
    5. Switch back to Xamarin Studio and see if the change sync correctly.

    Also the "correct" way to delete an Outlet or Action is as follows:

    1. Select the object to remove the Outlet or Action from in the Design Surface of Xcode's Interface Builder.
    2. Switch to the Connection Inspector and click the x button by the Outlet or Action to delete (see Figure 1).
    3. Switch to the Assistant Editor view and remove the line of code referencing the Outlet or Action from the .m file (see Figure 2).
    4. Switch to the .h file and remove the line of code referencing the Outlet or Action (see Figure 3).
    5. Save your changes and switch back to Xamarin Studio to sync.

    Please let us know if you are still having issues.

    Thanks,

    Kevin

  • NinineaNininea USUniversity ✭✭✭
    edited October 2016

    I have tried , but still the same result.

    here is one confusing point , inside xcode , it show three storyboard file, instead of one, see the picture :

    I have removed one of them, but after rebuild xamarin project it is regenerated

  • NinineaNininea USUniversity ✭✭✭

    Here are many problems in my project for now, after last update.

    when I just close the model window , main window is closed itself, I cant't see any exceptions or logs in application output file. I think it is caused by connections between xcode and xamarin studio. as I mentioned previous comment , after changes here is generated second .storyboard file, I have no idea what the reason is :( any help?

  • NinineaNininea USUniversity ✭✭✭

    here is log , what I get now :

    2016-10-13 12:34:21.656 MYApp[7945:1359200] Unknown class MainController in Interface Builder file at path /.../MYApp.app/Contents/Resources/Main.storyboardc/MainWindow.nib.
    2016-10-13 12:34:21.662 MYApp[7945:1359200] Unknown Window class MainViewController in Interface Builder file,
    creating generic Window instead

  • NinineaNininea USUniversity ✭✭✭

    I find some answer for the previous question : http://stackoverflow.com/questions/24924966/xcode-6-strange-bug-unknown-class-in-interface-builder-file

    but, when I open the xamarin project in xcode module section is always empty

  • NinineaNininea USUniversity ✭✭✭
    edited October 2016

    @ChrisHamons http://pastebin.com/fLMbrqDy here is the latest log file

  • NinineaNininea USUniversity ✭✭✭

    @KMullins here is application output log from my XS:

    2016-10-13 17:11:15.508 MYAPP[12942:1794538] Failed to connect (AllPhotosClicked) outlet from (MenuViewController) to (NSButton): missing setter or instance variable
    2016-10-13 17:11:15.509 MYAPP[12942:1794538] Failed to connect (ImportClicked) outlet from (MenuViewController) to (NSButton): missing setter or instance variable
    2016-10-13 17:11:15.510 MYAPP[12942:1794538] Failed to connect (SettingsClicked) outlet from (MenuViewController) to (NSButton): missing setter or instance variable
    2016-10-13 17:11:15.523 MYAPP[12942:1794538] Failed to connect (DeletePatientClicked) outlet from (PatientListViewController) to (NSButton): missing setter or instance variable

    and here is MenuViewController view in xcode, is seems every outlet is connected

  • WishbonesWishbones GBMember

    Did you resolve this? I may be jumping to conclusions, but it looks like I can recreate something similar on VS for Mac by creating a ViewController with View in a folder path that is two levels deep - Projectname/Flows/DashboardFlow/

    If I create in a folder one level deep, then I don't get the error. (I'll keep trying a few variations to see if I can workout what's really going wrong.)

  • intvsteveintvsteve USMember ✭✭

    Hmm... I haven't created any new View / ViewController classes recently, but I've got a couple dozen such types that have made the long trip from MonoMac to Xamarin.Mac that are in pretty deeply nested folders and none of them exhibit this problem.

    The code did expose a stale binding I'd left behind in the code years ago, though!

    I'm going to qualify this as follows:
    a) All these types build correctly and run just fine in Xamarin Studio
    b) They all build just fine in Visual Studio for Mac -- however, due to other issues, I've not yet been able to run the program to see if you're onto something, @Wishbones

Sign In or Register to comment.