[MonoTouch] Issue with CFRunLoop still in v1.1

Geoff Norton gnorton at novell.com
Fri Oct 2 15:05:23 EDT 2009


Jose,

   Are you getting the same crash as before?  If so can you reopen the  
bug and attach the new test case and I'll take a look

Thanks

Geoff Norton

On 2009-10-02, at 2:45 PM, José Antonio Leal Farias  
<jalf at sharpgames.net> wrote:

> Folks,
>
> I'm getting a new error using UIAccelerometer and CFRunLoop together
> in v1.1. Check this code:
>
> using MonoTouch.CoreFoundation;
> using MonoTouch.Foundation;
> using MonoTouch.UIKit;
> using System;
>
> namespace LoopTest
> {
>    public static class Accelerometer
>    {
>        public static void SetupAccelerometer()
>        {
>            // Setup the accelerometer
>            UIAccelerometer.SharedAccelerometer.UpdateInterval = 1/30;
>            UIAccelerometer.SharedAccelerometer.Acceleration +=
> UIAccelerometerSharedAccelerometerAcceleration;
>         }
>
>        private static void  
> UIAccelerometerSharedAccelerometerAcceleration
> (object sender, UIAccelerometerEventArgs e)
>        {
>            Console.WriteLine("Move");
>        }
>    }
>
>    [Register ("AppDelegate")]
>    class Program : UIApplicationDelegate
>    {
>        public override void FinishedLaunching (UIApplication app)
>        {
>            Accelerometer.SetupAccelerometer();
>            while (true)
>            {
>                while(CFRunLoop.Main.RunInMode(CFRunLoop.ModeDefault, 
> 0,true) ==
> CFRunLoopExitReason.HandledSource);
>                Tick();
>            }
>        }
>
>        void Tick()
>        {
>            Console.WriteLine("Tick");
>        }
>
>        static void Main (string [] args)
>        {
>            UIApplication.Main (args,null,"AppDelegate");
>        }
>    }
> }
>
> My application crash all the times. It's a bug or I'm doing something
> wrong?
>
> José.
>
>
>
>
>
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch


More information about the MonoTouch mailing list