• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Repeating wrong
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Repeating wrong


  • Subject: Re: Repeating wrong
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 15 Jan 2010 09:51:30 +1100
  • Thread-topic: Repeating wrong

First, avoid using delay in ASObjC -- all other things aside, it kicks
processor use up to 100% or more.

You should make an NSTimer, which will repeatedly call a handler:

on trackWifiStats_(sender)
set theTimer to current application's NSTimer's
scheduledTimerWithTimeInterval_target_selector_userInfo_repeats_(1, me,
"timerFired:", "Whatever", true)
end trackWifiStats_

on timerFired_(theTimer) -- called by timer
    -- do your stuff
    -- To stop, use:
    -- theTimer's invalidate()
end timerFired_

You shouldn't need that check for sender's intValue(), either.

--
Shane Stanley <email@hidden>
AppleScript Pro, April 2010, Florida <http://www.applescriptpro.com>


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Repeating wrong
      • From: "John C. Welch" <email@hidden>
References: 
 >Repeating wrong (From: "John C. Welch" <email@hidden>)

  • Prev by Date: Re: applescriptobjc-dev Digest, Vol 3, Issue 4
  • Next by Date: Re: Repeating wrong
  • Previous by thread: Repeating wrong
  • Next by thread: Re: Repeating wrong
  • Index(es):
    • Date
    • Thread