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
-1
votes
2 answers

there is no async in main queue?

as we know main_queue is a serial queue。There is no real async。 - (void)someMethod{ dispatch_async(dispatch_get_main_queue(),^{ NSLog(@"main_async invoke"); }); NSLog(@"method invoke"); } the code above "method invoke" will be write…
-1
votes
1 answer

Need help using init(fireAt:) timer

I want to use the init(fireAt:interval:target:selector:userInfo:repeats:) timer to call a specific function at a specific time. But the problem is that i don't know how to initialize it. in the documentation it says that: 'You must add the new…
-1
votes
1 answer

Why should we do all the UI related tasks on main thread?

Can't we create a different thread and start a runloop that would listen for touch events or anything related to UI? Is there any research going on to handle UI tasks in multithreaded environment?
Anshu
  • 511
  • 1
  • 5
  • 15
-1
votes
1 answer

cancelPreviousPerformRequest vs cancelAllOperations

i use now both but i'm not sure which is better. what is exactly the difference? fuzzy question i know. preparing for wwdc
mahal tertin
  • 3,239
  • 24
  • 41
-1
votes
1 answer

How to notify the background thread from the main thread when there is something needs to be processed

I am working on an app that does image processing and displays the resulting image. Im using UIScrollView to let user scroll all images, because the image is not a standard jpg or png, it takes time to load. so i want to use a thread to load image,…
chancyWu
  • 14,073
  • 11
  • 62
  • 81
-3
votes
1 answer

Second try on how to understand run loops

Possible Duplicate: How a runloop actually works Hi I have asked these two questions earlier, but yet I do not understand it. Question about Runloops 1 Question about Runloops 2 In one of my iPhone-books they mention the run loop as this: ”Your…
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
1 2 3
8
9