Re: [Ikvm-developers] Using C# attributes from Java
Brought to you by:
jfrijters
|
From: Michael B. <md...@sa...> - 2013-04-29 17:25:50
|
On Mon, Apr 29, 2013 at 9:53 AM, Jeroen Frijters <je...@su...> wrote:
> So, in short, I don't think this is a problem.
>
Hrm. The underlying issue is that MonoTouch uses C# attributes to do some
magical Objective-C binding under the hood.
One normally writes (in C#):
[Register ("AppDelegate")]
public class AppDelegate : UIApplicationDelegate {
}
public class Application {
static void Main (string[] args) {
UIApplication.Main(args, null, "AppDelegate");
}
}
but if I try to write this bootstrap code in Java:
@RegisterAttribute.Annotation("AppDelegate")
public class AppDelegate extends UIApplicationDelegate {
}
(with the Application class still defined in C#), then it fails, claiming
that no class exists that is annotated as "AppDelegate".
Clearly there are other places where things could be going awry, but the
anomalies that I saw in the disassemblies seemed like a useful place to
start.
There should (in theory) be no difference between the above two snippets of
code, right? (Assuming the imports are the same, which they are.)
-- md...@sa...
|