This works fine:
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
mTimer = [[NSTimer alloc] initWithFireDate: ... interval: ...
target:self selector:@selector(...:) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:mAudioIdleTimer
forMode:NSDefaultRunLoopMode];
[[NSRunLoop currentRunLoop] addTimer:mAudioIdleTimer
forMode:NSModalPanelRunLoopMode];
[[NSRunLoop currentRunLoop] addTimer:mAudioIdleTimer
forMode:NSEventTrackingRunLoopMode];
while (...) [[NSRunLoop currentRunLoop] runUntilDate:[NSDate
dateWithTimeIntervalSinceNow:1.]];
[pool release];
On 24.09.2008, at 23:15, Jason Bobier wrote:
Hey folks, I have a runloop on a thread that looks like this:
while (! _cancelled) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[runloop runMode:NSDefaultRunLoopMode beforeDate:[NSDate
distantFuture]];
[pool release];
}
And I put a timer in the loop that sets _cancelled to true, the
runloop never stops. What's the proper way to do this?
Thanks,
Jason
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/muravievd%40gmail.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]