ios timers. turning them on/off from elsewhere

  1. 2 weeks ago

    Dick B

    Jan 14 Pre-Release Testers, Xojo Pro Amsterdam

    I have problems akin to the problems I have with iOSViews. I have difficulties to refer to them as I was used to refer to windows and timers in desktop XOJO apps.
    To illustrate: I have 1 view with 1 label and 1 timer that I dragged from the Liibrary, the timer is called Timer1
    The timer is set to multiple 1 per second firing according to the Inspector.
    In the action part I switch the visible property of the label. This runs fine and gives me a flashing label

    Now I don't want to start this flashing of the label right away. So I set the run mode to off with the Inspector and try to switch the timer1 on in the 'open' event of the view (so right away). The code in the open event is:
    >> Timer1.runmode =Timer.Runmodes.Multiple.<<
    This line on itself results in a host of error messages (while it is identical to what the docs prescribe.)
    The debugger is complaining that Xojo.Core.Timer has no member named run mode_timer (???????)
    that item timer1.runmode not exist etc etc

    I still seem to have a conceptual problem here (I tried to 'create' a NEW timer1 and work with that instance but that didn't solve the problem). Maybe someone has an example.
    I would be extremely grateful because this is by far the greatest hurdle for transferring DT apps to the iPhone. Apart from numerous smaller differences that are annoying but easily solvable with a search in the docs.

    D i c k

    Timer1.Mode = Xojo.Core.Timer.Modes.Multiple

    I recommend you review the documentation.
    http://docs.xojo.com/Xojo.Core.Timer.Mode

    When in iOS review docs from here:
    http://docs.xojo.com/Category:iOS
    This is all the stuff for iOS

  2. Derk J

    Jan 14 Pre-Release Testers, Xojo Pro Answer
    Edited 2 weeks ago
    Timer1.Mode = Xojo.Core.Timer.Modes.Multiple

    I recommend you review the documentation.
    http://docs.xojo.com/Xojo.Core.Timer.Mode

    When in iOS review docs from here:
    http://docs.xojo.com/Category:iOS
    This is all the stuff for iOS

  3. Dick B

    Jan 14 Pre-Release Testers, Xojo Pro Amsterdam

    Hi Derk,
    Thanks a lot. I see the problem. I ended up in the general docs rather than in the iOS specific part.
    D i c k

  4. Gavin S

    Jan 14 Pre-Release Testers, Xojo Pro, Forum Moderators, MVP UK

    Right now, this is how things stand in Xojo:
    • The Timer class is for Desktop
    • The WebTimer class is obviously for Web projects
    • Xojo.Core.Timer is pretty much just for iOS

    Timer1 in your code is a Xojo.Core.Timer and that's fine. But you're then trying to assign Timer.Runmode.Multiple as its Mode and in this case, Timer is referring to the Timer class, a Desktop class. So, as @Derk J says, you need to assign a Mode from Xojo.CoreTimer.Modes.

or Sign Up to reply!