diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-08-23 11:02:20 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-08-23 11:02:20 +0400 |
commit | ad196f99c602096995c198fd8e7e10fbc09c5011 (patch) | |
tree | c6e99c4da3bb7999f83fd5d53db68db6d2d93850 /main | |
parent | 6b3680ef10ea4362826607349c848ee07f89ddc8 (diff) |
Use CliType, when the ObjCType is not available for outbound syncing.
Y that's potentially not correct - but in the example project in 'Bug
337 - MonoDevelop 2.8a1 its not synching correctly with Xcode 4 xibs'
it works. In any case this is better that generating empty out bound
types - the user has the chance to fix it. In any case the right
approach is to never generate invalid designer files so this work
around is more an insanity check.
Diffstat (limited to 'main')
-rw-r--r-- | main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectTypeInfo.cs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectTypeInfo.cs b/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectTypeInfo.cs index 11fc3c12e3..a74ff78aa9 100644 --- a/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectTypeInfo.cs +++ b/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectTypeInfo.cs @@ -30,6 +30,7 @@ using System.Linq; using System.CodeDom; using System.CodeDom.Compiler; using System.IO; +using MonoDevelop.Core; namespace MonoDevelop.MacDev.ObjCIntegration { @@ -103,7 +104,13 @@ namespace MonoDevelop.MacDev.ObjCIntegration sw.WriteLine (); foreach (var outlet in Outlets) { - sw.WriteLine ("@property (nonatomic, retain) IBOutlet {0} *{1};", AsId (outlet.ObjCType), outlet.ObjCName); + var type = AsId (outlet.ObjCType); + if (string.IsNullOrEmpty (type)) { + LoggingService.LogError ("Can't generate outlet property for: " + outlet.CliName +" no obj c type. Using cli type " + outlet.CliType + " instead."); + type = AsId (outlet.CliType); + sw.WriteLine ("// FIXME: The type '{0}' couldn't be resolved. It may be incorrect."); + } + sw.WriteLine ("@property (nonatomic, retain) IBOutlet {0} *{1};", type, outlet.ObjCName); sw.WriteLine (); } |