[Mono-bugs] [Bug 548126] Get cast exception when calling Runtime.GetNSObject()

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Nov 2 15:03:48 EST 2009


User duane at wandless.net added comment

Duane Wandless <duane at wandless.net> changed:

           What    |Removed                     |Added
             Status|NEEDINFO                    |NEW
      Info Provider|duane at wandless.net          |

--- Comment #2 from Duane Wandless <duane at wandless.net>  2009-11-02 13:03:47 MST ---
I was always linking with the correct architecture binding.  So this remains an
issue with:

$ /Developer/MonoTouch/usr/bin/mtouch --version

So running:
/Developer/MonoTouch/usr/bin/btouch gen.cs -outdir=./tmp

then referencing to the generated gen.dll in a project and calling:
Cocos2D.Director.SharedDirector(); causes invalid cast exception:

Error connecting stdout and stderr (
2009-11-02 15:02:06.089 testcase548126[822:207] cocos2d v0.8.2 - beta
2009-11-02 15:02:06.090 testcase548126[822:207] Using Director

Unhandled Exception: System.InvalidCastException: Cannot cast from source type
to destination type.
  at Cocos2D.Director.SharedDirector () [0x00000] 
  at testcase548126.AppDelegate.FinishedLaunching
(MonoTouch.UIKit.UIApplication app, MonoTouch.Foundation.NSDictionary options)
  at (wrapper managed-to-native)
MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String
principalClassName, System.String delegateClassName) [0x00000] 
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args) [0x00000] 
  at testcase548126.Application.Main (System.String[] args) [0x00000]

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list