I have a stack trace for this now - happens in the iPhone Simulator
with debug-mode code too:

  at System.Activator.CreateInstance (System.Type type, BindingFlags
bindingAttr, System.Reflection.Binder binder, System.Object[] args,
System.Globalization.CultureInfo culture, System.Object[]
activationAttributes) [0x000f1] in
/Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:280
  at System.Activator.CreateInstance (System.Type type,
System.Object[] args, System.Object[] activationAttributes) [0x00000]
in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:234
  at System.Activator.CreateInstance (System.Type type,
System.Object[] args) [0x00000] in
/Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:229
  at MonoTouch.ObjCRuntime.Runtime.ConstructNSObject (IntPtr ptr,
IntPtr klass) [0x0000d] in
/Users/plasma/Source/iphone/monotouch/ObjCRuntime/Runtime.cs:154
  at MonoTouch.ObjCRuntime.Runtime.GetNSObject (IntPtr ptr) [0x0001f]
in /Users/plasma/Source/iphone/monotouch/ObjCRuntime/Runtime.cs:197
  at MonoTouch.ObjCRuntime.Runtime.GetNSObjectWrapped (IntPtr ptr)
[0x00000] in /Users/plasma/Source/iphone/monotouch/ObjCRuntime/Runtime.cs:214
  at (wrapper native-to-managed)
MonoTouch.ObjCRuntime.Runtime:GetNSObjectWrapped (intptr)
  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)
[0x00038] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:26
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args)
[0x00000] in /Users/plasma/Source/iphone/monotouch/UIKit/UIApplication.cs:31
  at MyNamespace.Application.Main (System.String[] args) [0x00016] in
/Users/tf/Projects/MyApp/trunk/MyGuiProject/Main.cs:25

On Mon, Jul 18, 2011 at 11:18 PM, Tom Fanning <[email protected]> wrote:
> Weird one this.
>
> In a ViewController I call the following code in ViewDidLoad():
>
> AudioSession.Initialize();
> AudioSession.Category = AudioSessionCategory.MediaPlayback;
> AudioSession.SetActive(true);
>
> Then in response to some button presses I do:
>
> NSError err;
> var ap = AVAudioPlayer.FromUrl(new NSUrl("mysound.caf"), out err);
> ap.FinishedPlaying += delegate { ap.Dispose(); };
> ap.Play();
>
> And this works great, pretty responsive etc.
>
> Except sometimes, seemingly randomly, I get the following unhandled
> exception in release mode on the device (iPhone 3GS):
>
> System.MissingMethodException: No constructor found for
> MonoTouch.AVFoundation.InternalAVAudioPlayerDelegate::.ctor(System.IntPtr)
>
> Any ideas? Google comes up blank for that specific missing constructor.
>
> Thanks
> Tom
>
> --
> Tom Fanning
>



-- 
Tom Fanning
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to