user991811
user991811

Reputation: 1

Running Secondary Threads in Background Continuosly

I need to create a new thread which will have infinite while loop, so that it won't block main UI thread. The newly created thread is getting killed when I send the application to background mode, But I need to run it in background. Any help?

Upvotes: 0

Views: 125

Answers (1)

bbum
bbum

Reputation: 162722

There is a difference between a Background Thread and a Background Task in iOS, but the underlying answer remains the same; don't run a background thread unless you simply cannot avoid it. Furthermore, you can't just spin off a thread and have it run if your app wants to support backgrounding in iOS.

First, you should read the documentation. It is extensive and provides many examples.

Then, if you have any specific questions not covered by the docs (or to clarify the docs), ask 'em here!

Upvotes: 2

Related Questions