Bug 18204 - ObjC header generation ignores classes registered using constants instead of literals
Summary: ObjC header generation ignores classes registered using constants instead of ...
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 7.0.6.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-03-05 19:43 UTC by Adam Kemp
Modified: 2014-03-06 11:19 UTC (History)
3 users (show)

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


Attachments
Example project (10.18 KB, application/zip)
2014-03-05 19:43 UTC, Adam Kemp
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 Adam Kemp 2014-03-05 19:43:40 UTC
Created attachment 6236 [details]
Example project

When you open a .xib the following class will not have a header file accessible from Xcode:

[Register(Foo.ClassName)]
public class Foo : UIView
{
    private const string ClassName = "Foo";
    // ...
}

The result is that you can't set up outlets/actions from Xcode with this class. The same class would have a header file in Xcode if you replace Foo.ClassName with the literal string "Foo".

I would like either approach to work because I want to avoid making a typo in the string (it may appear in multiple places).

To reproduce open the attached project and then double click on one of the .xib files. Notice that in the resulting Xcode project there is a header file for RegisteredWithLiteral, but there is not a header file for RegisteredWithConst.
Comment 1 Sadik Ali 2014-03-06 01:38:06 UTC
I have checked this issue with attached project on below environments:

All MAC
XS 4.2.3 (Build 59)
X iOS 7.0.6.168

I have checked this issue with attached test project and followed steps as mentioned in bug description, I opened .xib file in Xcode and noticed that both "RegisteredWithLiteral" and  "RegisteredWithConst" header file displayed on Xcode. Refer screen cast: http://screencast.com/t/E45CGbzla
Comment 2 Adam Kemp 2014-03-06 11:19:01 UTC
Looks like it was fixed in a later Xamarin Studio (or Xamarin.iOS?). I was holding back on upgrading because of another issue with provisioning profiles, but that appears to be fixed now as well (not sure when that happened...).

Sorry for the noise!