Re: Confused about CFRunLoop
Re: Confused about CFRunLoop
- Subject: Re: Confused about CFRunLoop
- From: "Kyle Sluder" <email@hidden>
- Date: Mon, 17 Mar 2008 22:59:37 -0400
On Mon, Mar 17, 2008 at 10:53 PM, Brian Greenstone <email@hidden> wrote:
> I'm trying to convert some old Carbon code over to Cocoa, and one of
> the things I'm doing is converting my old run-loop timers. I used to
> use the following code:
Are you sure you want to be creating your own run loops? Every Cocoa
thread has a default run loop which you can get with +[NSRunLoop
currentRunLoop], and the main thread's run loop is running by default
(technically, this is what happens when you call -[NSApplication run],
which NSApplicationMain() does for you).
If all you're trying to do is create a scheduled timer, use +[NSTimer
scheduledTimerWithTimeInterval:invocation:repeats:] or one of the
other NSTimer class methods.
--Kyle Sluder
_______________________________________________
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