Re: Run Function At Intervals in Cocoa
Re: Run Function At Intervals in Cocoa
- Subject: Re: Run Function At Intervals in Cocoa
- From: Ken Thomases <email@hidden>
- Date: Mon, 13 Oct 2008 16:19:05 -0500
On Oct 13, 2008, at 4:02 PM, Eric Lee wrote:
On Oct 13, 2008, at 10:47 AM, Pierce Freeman wrote:
Hi everyone. I am fairly new to Cocoa, so I apologize if this is a
very
basic question (but after searching for awhile I still can't find an
answer). Anyway, I am wondering how I can create a function that
will run
at intervals. What the function would do is scan which
applications are
open, and then output a message to the user if there is a certain
application open (I have already created this part of it). If
anyone could
help, that would be great.
Check out NSTimer, NSTimeInterval, and NSRunLoop
Even better, though, would be to use the techniques described in this
Technical Note, which avoids the polling that you're trying to do: http://developer.apple.com/technotes/tn/tn2050.html
Cheers,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden