Bug 7199 - Namespace in designer file should use global namespace
Summary: Namespace in designer file should use global namespace
Status: RESOLVED DUPLICATE of bug 1702
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: 3.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jeffrey Stedfast
URL:
Depends on:
Blocks:
 
Reported: 2012-09-16 10:21 UTC by Bart Verkoeijen
Modified: 2012-10-15 18:23 UTC (History)
4 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 DUPLICATE of bug 1702

Description Bart Verkoeijen 2012-09-16 10:21:37 UTC
In my project namespace structure, I use the platform name in the namespace. For instance, I have something like MyProject.App.MonoTouch to include all MonoTouch related application code.

When I created a custom ViewController in MonoTouch, and when I returned from Xcode to MonoDevelop, I could not open the .xib file again, because it prompts the error message: "Error updating Xcode project. Could not generate outlet 'myOutletName' in class 'MyProject.App.MonoTouch.MyClass' as its type '?' could not be resolved to Objective-C."

In the designer file (e.g. 'MyClass.designer.cs') the references to the UI controls are marked in red in MonoDevelop, except for the 'MonoTouch' part of the namespace.

When typing 'MonoTouch.' in the class, it shows the auto complete list for the project namespace, instead of the MonoTouch library namespace. Obviously, there is a namespacing conflict.

Therefore, the designer should create global namespaces (e.g. 'global::MonoTouch.UIKit.UILabel') if the automatically generated partial class is in a MonoTouch namespace (e.g. 'MyProject.App.MonoTouch').

How to reproduce the bug: create a MonoTouch project, save it with namespace 'TestBug.MonoTouch'. Then add a ViewController, add a label to the view controller, and create an outlet for the label. Then save and close Xcode. Then, try to open the .xib file again, it will prompt with an error message.
Comment 1 timb 2012-09-28 12:40:19 UTC
Vote 1 for this ... as fate would have it I have run in to the same problem as Bart at the same time
Comment 2 Jeffrey Stedfast 2012-10-15 18:23:28 UTC

*** This bug has been marked as a duplicate of bug 1702 ***