Bug 337 - MonoDevelop 2.8a1 its not synching correctly with Xcode 4 xibs
Summary: MonoDevelop 2.8a1 its not synching correctly with Xcode 4 xibs
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: iOS add-in ()
Version: unspecified
Hardware: PC Mac OS
: --- major
Target Milestone: ---
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2011-08-19 12:54 UTC by Alex Soto
Modified: 2011-08-29 04:07 UTC (History)
3 users (show)

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


Attachments
Project (6.69 MB, application/zip)
2011-08-19 12:54 UTC, Alex Soto
Details
Latest attached project done with master (2.88 MB, application/zip)
2011-08-22 14:56 UTC, Alex Soto
Details
Make Command output (168.31 KB, text/plain)
2011-08-23 14:23 UTC, Alex Soto
Details


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 Alex Soto 2011-08-19 12:54:11 UTC
Created attachment 156 [details]
Project

I've created a simple project with just one button and one label, when creating outlets on Xcode4.2 and hitting save on it, then switching back to monodevelop 2.8 i open the automatically generated designer file and i get this

using MonoTouch.Foundation;

namespace HolaMDNew
{
	[Register ("HolaMDNewViewController")]
	partial class HolaMDNewViewController
	{
		[Outlet]
		 btnHola { get; set; }

		[Outlet]
		 lblResp { get; set; }

		[Action ("PushedButton:")]
		partial void PushedButton (MonoTouch.Foundation.NSObject sender);
	}
}

witch doesn't work variable types are being missed by the MD synching task but if i manually add variable types it works as expected.

using MonoTouch.Foundation;

namespace HolaMDNew
{
	[Register ("HolaMDNewViewController")]
	partial class HolaMDNewViewController
	{
		[Outlet]
		MonoTouch.UIKit.UIButton btnHola { get; set; }

		[Outlet]
		MonoTouch.UIKit.UILabel lblResp { get; set; }

		[Action ("PushedButton:")]
		partial void PushedButton (MonoTouch.Foundation.NSObject sender);
	}
}

I've attached the sample project so you guys can reproduce this :)
Comment 1 Mikayla Hutchinson [MSFT] 2011-08-19 13:10:56 UTC
Looks like a bugs in resolving obj-c types to xcode types. We should error out instead of inserting blanks.
Comment 2 Mike Krüger 2011-08-22 03:36:45 UTC
Can you reproduce the bug ? I've problems doing it. If you can it would be nice if you could attach the .h file where the outlets are inserted.
Comment 3 Mike Krüger 2011-08-22 04:45:58 UTC
I've added some error handling code which should help to track down that issue - if anyone could reproduce that with master it would be very helpful.

Anyways it shouldn't  generate empty types anymore. Setting that to 'needinfo' - I need the info if it can be reproduced with the trunk version & if so I need the output from the console or internal message protocol.
Comment 4 Alex Soto 2011-08-22 10:45:39 UTC
Ok, let me download and compile master and ill give this a try
Comment 5 Alex Soto 2011-08-22 11:36:14 UTC
im not able to build MD from master, when i run ./configure with mac profile i get 

Configuring package: main
-------------------------
Configuration options:  --disable-update-mimedb --disable-update-desktopdb --disable-gnomeplatform --enable-macplatform --enable-tests
Running aclocal  ...
Running automake --foreign  ...
Running autoconf ...
Running ./configure --enable-maintainer-mode --enable-compile-warnings --prefix=/usr/local --disable-update-mimedb --disable-update-desktopdb --disable-gnomeplatform --enable-macplatform --enable-tests ...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... yes
checking for mono... /usr/bin/mono
checking for gmcs... /usr/bin/gmcs
checking for pkg-config... /usr/bin/pkg-config
checking for msgfmt... no
configure: error: You need to install msgfmt from intltool

how can I install that ?? ^
Comment 6 Mikayla Hutchinson [MSFT] 2011-08-22 11:53:48 UTC
You need the Mono SDK package, not the runtime package. See http://monodevelop.com/Developers/Mac_Support/Building_MonoDevelop_on_OS_X

MD master doesn't include the iphone addin any more, however the Xcode synching code is in MD master so you could copy the addin the 2.8a1 app bundle, but it would be easier if we gave you a dmg. Mike, could you create a dmg with these changes?
Comment 7 Alex Soto 2011-08-22 12:10:20 UTC
thanks Michael that would be really helpful since I'm not very well versed on command line, just for the record the package i downloaded and installed from Mono project page was

MonoFramework-MDK-2.10.4_0.macos10.xamarin.x86.dmg

isn't MDK = SDK??

Alex
Comment 8 Mikayla Hutchinson [MSFT] 2011-08-22 12:50:43 UTC
Yes, it is. Did you follow the other instructions re. PATH etc?
Comment 9 Alex Soto 2011-08-22 14:50:33 UTC
Ok, got it working with trunk version of MD, i created a new iPhone project and opened Xcode 4 added 2 buttons and 1 label but didn't work either

I created 2 outlets 1 for the button1 and another for the label, and 1 action for the second button saved that on Xcode 4 and when i focused MD i got a popup with the following message

Error While Syncing Objective c type.
Type "UIButton" cannot be resolved to a valid cli type.

Error While Syncing Objective c type.
Type "UILabel" cannot be resolved to a valid cli type.

then the output on the designer file its the following

using MonoTouch.Foundation;

namespace HolaMD28iPhone
{
	[Register ("HolaMD28iPhoneViewController")]
	partial class HolaMD28iPhoneViewController
	{
		[Outlet]
		UIButton btnHola1 { get; set; }

		[Outlet]
		UILabel lblText { get; set; }

		[Action ("Presione2:")]
		partial void Presione2 (MonoTouch.Foundation.NSObject sender);
	}
}

I will attach the whole project

Alex
Comment 10 Alex Soto 2011-08-22 14:56:16 UTC
Created attachment 163 [details]
Latest attached project done with master
Comment 11 Mikayla Hutchinson [MSFT] 2011-08-22 18:41:37 UTC
Mike, that reveals two issues, firstly the resolution failure, secondly when we can't resolve types we shouldn't insert an invalid value into the file.
Comment 12 Mike Krüger 2011-08-23 03:09:30 UTC
Ok, that helps you're running into a parser service problem. I assume that maybe one of the code completion data files contains an error.

Can you try to remove all MonoDevelop* directories in ~/Library/Caches and try it again ?

(Anyways I added some more code to ensure that no invalid file is generated)
Comment 13 Alex Soto 2011-08-23 14:23:05 UTC
Created attachment 169 [details]
Make Command output

Sorry mike, I updated my monodevelop git clone and tried to "make" again and its failing, I'm not able to compile MD so I'm not able to test this out 

Im getting this output from make command
Comment 14 Alex Soto 2011-08-23 14:23:45 UTC
any ideas?
Comment 15 Mike Krüger 2011-08-24 01:02:16 UTC
You don't need the new build, just remove the monodevelop cache. The new build doesn't solve the error - it just handles it more nicely.

Now I need to search the cause - my guess is that it's the parser database that's causing the problem.

Can you remove the MonoDevelop* paths in ~/Library/Caches - they're in that system directory and containing all code completion databases. If you remove them they're regenerated and the resolving >may< work.

If it works I know the cause.
Comment 16 Alex Soto 2011-08-26 11:31:32 UTC
Hello Mike, sorry I've been little busy , ok, that worked like a charm, and now also I'm testing MD 2.8a2 and I have not ran into any problems with xcode and MD sync so far :), so shall we close this bug? =)
Comment 17 Alex Soto 2011-08-26 11:32:35 UTC
Also Tested the branch MonoDevelop with xcode and works great too :)
Comment 18 Mike Krüger 2011-08-29 04:07:55 UTC
Ok I'll close it - thanks for your patience.