Questions tagged [nsrunloop]

NSRunLoop is a class in Apple's Foundation framework. It processes inputs such as user events, network activity, and NSTimer events.

NSRunLoop is a class in Apple's Foundation framework for OS X and iOS. It processes inputs such as user events, network activity, and NSTimer events. Each NSThread object automatically receives its own NSRunLoop; apps cannot explicitly create or manage NSRunLoop objects.

353 questions
0
votes
1 answer

NSTimer / NSRunLoop issues

I'm making a CLI tool for Mac OS X, my main looks something like this: int main(int argc, const char * argv[]){ @autoreleasepool { //Some startup stuff here [ServerPool sharedPool]; //Start the pool /* UI…
Ryan Copley
  • 873
  • 1
  • 10
  • 26
0
votes
4 answers

Is NSRunLoop thread safe?

I am little confused whether NSRunLoop is thread safe or not. So I need some clarification is it thread safe or not and why? Any help is appreciable.
Nishant Tyagi
  • 9,893
  • 3
  • 40
  • 61
0
votes
0 answers

Replace a runloop (of type CFRunLoop) with a new runloop (of type NSRunLoop)?

(UPDATED) It seems that Apple's version of unit-testing (the SenTest framework) uses a CFRunLoop instead of the standard NSRunLoop - which is only partially toll-free-bridged. This causes certain classes - in particular: any networking - to receive…
Adam
  • 32,900
  • 16
  • 126
  • 153
0
votes
1 answer

Releasing resources at end of NSRunLoop

I am trying to release resources allocated in daemon process at the end of it or if someone quits the process. Lets say, int main(int argc, const char * argv[]) { Controller *controller = [[Controller alloc] init]; [controller…
RLT
  • 4,219
  • 4
  • 37
  • 91
0
votes
1 answer

GCD and Thread Wait

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ while(!weakSelf.isAnotherThreadCompleted && [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]) ; …
taffarel
  • 4,015
  • 4
  • 33
  • 61
0
votes
2 answers

what is the maximum value that can be assigned to rununtildate for runloop?

I am trying to make this runloop run forever(if not forever atleast for a single day) I am using the following function for runloop [self.runLoop runUntilDate:[NSDate dateWithTimeIntervalSinceNow:100000]]; The problem is that the app crashes after 3…
zzzzz
  • 1,209
  • 2
  • 18
  • 45
0
votes
2 answers

iphone cocoa use of nsrunloop

I find myself using a combination of global vars and nsrunloop to force synchronization throughout my application. Although it works it seems a bit ugly to me. Is there any other way of achieving the same result? Here's a typically…
ennuikiller
  • 46,381
  • 14
  • 112
  • 137
0
votes
1 answer

Detail about nsrunloop

Possible Duplicate: Understanding NSRunLoop Till now I know that every thread has its own runloop I don't know whether I'm thinking right. I don't have a brief idea about nsrunloop but I'd like to know what is nsrunloop and what it's purpose and…
Exploring
  • 925
  • 6
  • 18
0
votes
1 answer

gnustep runloop

Does anyone tell is GNUstep NSRunLoop extension functions: (void) addEvent: (void*)data type: (RunLoopEventType)type watcher: (id)watcher forMode: (NSString*)mode; this method is work?, and how to setup the argument data? I set a pipe to…
codeplay
  • 620
  • 1
  • 6
  • 19
0
votes
1 answer

How to add a timer when application entering background state?

Here is what I have tried so far: - (void)applicationWillResignActive:(UIApplication *)application { timer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(triggerTimer:) userInfo:nil repeats:FALSE]; NSRunLoop* runLoop =…
Adam Ivancza
  • 2,459
  • 1
  • 25
  • 36
0
votes
2 answers

NSThread causes UIWebView Crash

i would like to explain my issue from the beginning. I am creating a app with UIWebView. Also I am capturing the screen at the moment user using the app and create a video using that image array. I am using NSTimer to get screen shots of the screen.…
Sameera Chathuranga
  • 3,638
  • 3
  • 27
  • 48
0
votes
3 answers

Waiting for condition to continue

I have a method that I add to a GCD queue that I have created (so it's a serial queue) and then run it async. From within that block of code I make a dispatch to the main queue, when that block of code dispatched to the main queue is complete I set…
Peter Warbo
  • 11,136
  • 14
  • 98
  • 193
0
votes
1 answer

Is it possible to use runMode:beforeDate: with [NSDate dateWithTimeIntervalSinceNow:0]?

I'm trying to use the pattern described in: Grand Central Dispatch and unit testing, Pattern for unit testing async queue that calls main queue on completion and mainly in:…
Stanislav Pankevich
  • 11,044
  • 8
  • 69
  • 129
0
votes
1 answer

How to wake up thread after [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:distantFuture]?

I have a Download object which handles NSURLConnection. Then I have NSOperation object (DownloadOperation) which holds Download object as property. Download object has ability to start/pause/resume/cancel. This is the main method of…
vale4674
  • 4,161
  • 13
  • 47
  • 72
0
votes
2 answers

Understanding the Objective-C event loop

How can I log every message sent in a single iteration of the Objective-C event loop? I want to further my understanding of the Objective-C runtime and thought this would be a good start.
SundayMonday
  • 19,147
  • 29
  • 100
  • 154
1 2 3
23
24