Bug 5642 - MD 3.0.3.1 Beta - Second xib file launched from MD shows "No Assistant Results" in Xcode Assistant
Summary: MD 3.0.3.1 Beta - Second xib file launched from MD shows "No Assistant Result...
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: 3.0.x
Hardware: Macintosh Mac OS
: High normal
Target Milestone: ---
Assignee: Jeffrey Stedfast
URL:
Depends on:
Blocks:
 
Reported: 2012-06-13 22:08 UTC by Kerry Street
Modified: 2012-06-15 17:04 UTC (History)
2 users (show)

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

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 Kerry Street 2012-06-13 22:08:57 UTC
Overview:

    The second xib file launched from MonoDevelop does not show the associated .h interface code file when the Xcode Assistant is selected.  Assistant displays "No Assistant Results" instead.  This prevents drag/drop linking of view items to create outlets and actions in the .h file. 

Steps to Reproduce:

    1)  Create a new Empty iPhone project in MonoDevelop 3.0.3.1 BETA

    2)  Add a new iPhone View Controller named MainViewController

    3)  From MonoDevelop double-click MainViewController.xib 
    to launch Interface Builder in Xcode 4.3.2.  

    4)  Click the "Assistant" in Xcode to view the .h file
    (it usually shows the code file for the first ViewController)

    5)  Drag a Label control onto the View.

    6)  Hold control and drag/drop the line under the @interface definition in
    the .h file and choose Connection type Outlet, Name = TestLabel, "Connect"

    6)  Verify @property (retain, nonatomic) IBOutlet UILabel *TestLabel;
    gets added to the .h file.

    7)  Save in Xcode and LEAVE Xcode running, DO NOT EXIT the Xcode program.

    8)  Go back to MonoDevelop and add a SECOND iPhone View Controller
    named SecondViewController.

    9)  From MonoDevelop double-click SecondViewController.xib 
    to go back to Interface Builder in Xcode 4.3.2.

    10)  Click the "Assistant" in Xcode to view the .h file

    11)  Observe that the Assistant does NOT show the associated .h code file for
    the SecondViewController but instead says "No Assistant Results".

    12)  This prevents you from using drag/drop to attach Outlets to .h file.
    (and the associated designer.cs file in MD is unable to be updated from here) 

Actual Results:
    
    Assistant in Xcode does not show the .h code file for the ViewController but instead says "No Assistant Results".
   
Expected Results:

    When you click on the Assistant in Xcode after launching a xib file you expect to see the .h interface file that is associated with it so that you can connect Outlets and Action on the View to the code in the .h file that the Assistant should be displaying.

Additional Information:

This did not seem to happen in release version of MonoDevelop 3.0.2 but it is happening when using MonoDevelop 3.0.3.1 Beta.  It also seems important to NOT close Xcode before launching the second xib file as keeping it running seems to cause the most issues.

Runtime:
	Mono 2.10.9 (tarball)
	GTK 2.24.10
	GTK# (2.12.0.0)
	Package version: 210090011
Mono for Android not installed
Apple Developer Tools:
	 Xcode 4.3.2 (1177)
	 Build 4E2002
Monotouch: 5.2.12 (Evaluation)
Build information:
	Release ID: 30003001
	Git revision: 1b6ffb8235519a006d51afd98014ad20186cfd1b-dirty
	Build date: 2012-06-08 08:39:08+0000
	Xamarin addins: 62ad7268d38c2ece7e00dc32960bd3bdab8fec38
Operating System:
	Mac OS X 10.7.4
	Darwin mac.local 11.4.0 Darwin Kernel Version 11.4.0
	    Mon Apr  9 19:32:15 PDT 2012
	    root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64
Comment 1 Jeffrey Stedfast 2012-06-14 14:54:59 UTC
Sounds like MonoDevelop's project dom is not updating when the new file is added.

Mike: can you look into this?
Comment 2 Mike Krüger 2012-06-14 15:22:36 UTC
Adding an existing file to a new project works & the type system updates.

Are all events are fired ? (add file to project ?)
Comment 3 Jeffrey Stedfast 2012-06-14 16:19:08 UTC
fwiw, I can't reproduce this either.

Since I don't know how the type system decides whether or not it needs to update, I figured maybe there was some sort of race? Then again, not sure that's the case because I think the Xcode sync code forces a rescan of the types.
Comment 4 Mike Krüger 2012-06-14 16:51:04 UTC
It's updated when the event is fired - but the type system data structures shouldn't be cached.

ICompilation/IProject content is immutable and therefore don't change when the type system updates.
ProjectContentWrapper is not (that can be cached) - and the compilation/project content should always be taken from there (or the type system service, or the document).
Comment 5 Kerry Street 2012-06-14 23:43:39 UTC
I just tried this again today to make sure I could reproduce with the steps above and I was able to.

Because I am able to reproduce is there anything I can do to help?  Just let me know I am will try.

Thank you.
Comment 7 Mike Krüger 2012-06-15 02:46:08 UTC
http://screencast.com/t/EXK8SFw8N

The assistant doesn't even work for old .xib files anymore. From what I can tell the type system updates correctly. 

For the new .xib the .h file is generated as well btw. - but the link from .xib <--> .h is broken after the update.

@Jeff: Do you know how the linking works ? I suspect there may be a bug.
Comment 8 Jeffrey Stedfast 2012-06-15 11:26:26 UTC
Mike: your screencast made it kinda clear that the Xcode project started getting re-synced before all of the new files were added to the project (you could see the Xcode window change after the first of 3 files was added).

Xcode's project files don't do any sort of "linking" to associate header files with the .xibs, Xcode infers that by class names.

What is probably happening is that Xcode is opening the project with only the first file added in the .pbxproj file, then when files #2 and #3 get added, we re-sync the project files 2 more times and update the .pbxproj, re-asking Xcode to open that project, but since it is still in the process of opening the first .pbxproj file, it ignores the second & third requests (same path, seems reasonable to ignore?).

I don't know, just a theory.
Comment 9 Jeffrey Stedfast 2012-06-15 13:48:43 UTC
Confirmed... this is exactly what is happening :-(
Comment 10 Jeffrey Stedfast 2012-06-15 17:04:50 UTC
this is fixed now