Questions tagged [runloop]

A run loop is the concept of running a local loop waiting for a specific event or timeout.

A run loop is the concept of running a local loop waiting for a specific event or timeout.

Such a loop keeps the current thread busy and does not return until the loop has finished, which can either be by a timeout value, an explicit stop signal or if there are no events to process anymore (depends on the specific implementation). Message pumps/loops in applications to process incomming events are typical run loops. But there are other types of local loops (e.g. to make an originally asynchronous process synchronous).

126 questions
0
votes
1 answer

Crash at _CFAutoreleasePoolPop

I got a crash from Fabric,the stack is below: Thread : Crashed: com.apple.main-thread 0 libobjc.A.dylib 6806634868 objc_release + 20 1 libsystem_blocks.dylib 6813456656 _Block_release + 256 2 libobjc.A.dylib …
user2027712
  • 379
  • 4
  • 9
0
votes
0 answers

iOS9 NSDefaultRunLoopMode does not listen to didRegisterForRemoteNotificationsWithDeviceToken delegate

In iOS 9 the [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:timeoutDate]; does not listen to didRegisterForRemoteNotificationsWithDeviceToken or didFailToRegisterForRemoteNotificationsWithError delegate, however it listens to…
0
votes
1 answer

Can't figure out how to wrap function in Ember run loop

I have a component that integrates 2 third-party libraries, imagesLoaded and Isotope. I get conflicting test failures when running tests in the browser and cli mode. The error is: Error: Assertion Failed: You have turned on testing mode, which…
ancoanco
  • 220
  • 6
  • 17
0
votes
1 answer

What method actually got called when we set self.navigationItem.hidesBackButton = YES;

I am curious what method actually got called when we set self.navigationItem.hidesBackButton = YES/NO;. I'm curios because the property is not a method, when we assign to any value what actually running on the background, so it can hide or show Back…
tan
  • 97
  • 1
  • 9
0
votes
1 answer

Schedule for every afterRender for a View

I would like to run code every time a view is rendered. The closest I can get is to listen to every property that could change and explicitly schedule something on the run loop for afterRender, but I would love to just have a lifecycle hook like…
theazureshadow
  • 9,499
  • 5
  • 33
  • 48
0
votes
0 answers

Swift: Async callback in command line utility

I'm trying to fetch data from a website via a command line utility in swift. I'm using NSURLConnection for this. Like so: private let queue = NSOperationQueue.mainQueue() NSURLConnection.sendAsynchronousRequest(NSURLRequest(URL: url), queue: queue)…
Matthijn
  • 3,126
  • 9
  • 46
  • 69
0
votes
0 answers

catch exceptions in iOS main Runloop

UIApplication catch the exceptions in main run loop and rethrow it, for Mac, NSApplication has a reportException: which can get the NSException object, UIApplication does not provide this method. Is there similar thing which be used on iOS. the…
ExBen
  • 187
  • 1
  • 12
0
votes
1 answer

How to add a POSIX file descriptor to an iOS runloop so it indicates when data can be read?

I have a pipe in an iOS program and I want the main runloop (or any other runloop) to let me know when there is data to read... So how can I add the file descriptor for the pipe to the runloop? (I'm pretty sure under the hood the app must be running…
user2088639
0
votes
1 answer

Implementing run-loop

I'm writing a Python script that takes action when I press a key on my MIDI keyboard: # https://github.com/superquadratic/rtmidi-python/ import rtmidi_python as rtmidi def callback(message, time_stamp): print message, time_stamp midi_in =…
P i
  • 29,020
  • 36
  • 159
  • 267
0
votes
0 answers

Can you "jump to run loop"?

I'm into the production phase of my first major OSX application using xCode. It is an eCommerce app accessing eBay with numerous buttons initiating various api calls, and then parsing and displaying the results. It's gotten pretty big and as you…
Rickrcomm
  • 11
  • 2
0
votes
1 answer

What is the time delta or timestamp used for in game loop update methods?

For example in cocos2D: - (void)update:(ccTime)delta can someone explain what these time deltas or timestamps are used for? How are they relevant for how the game world is updated? Is it because we do not know the fps reliably and should not just…
openfrog
  • 40,201
  • 65
  • 225
  • 373
0
votes
4 answers

When is a Cocoa callback given controll?

I've been searching around the web for an answer to this one, but was unable to find an answer, on the other side I think it's something quite common thus there is a possibility I'm missing some keywords here. Anyhow, the problem is as follows: When…
Kaspa
  • 2,169
  • 3
  • 16
  • 18
0
votes
2 answers

NSRunloop in Thread

I get a problem here is the code - (void)start{ [[NSRunLoop currentRunLoop] runUntilDate:[NSDate distantFuture]]; } - (void)nlog{ NSLog(@"cool"); } - (void)main{ thread = [[NSThread alloc] initWithTarget:self…
Siverchen
  • 379
  • 2
  • 16
0
votes
2 answers

performSelector:onThread breaks runloop?

I'm not sure how to use the API performSelector:onThread and I need some suggestions here. As far as I known, I need a runloop to make the call of performSelector:onThread, so I made one. But then I find a problem : once I called…
-1
votes
1 answer

performSelector:onThread make runloop exited

enter image description here performSelector:onThread make the runloop exited? I try observer the runloop, when i touch, the runloop exited after finish handle performSelector:onThread , the timer stops working. i cant understand
Chen_
  • 59
  • 3
1 2 3
8
9