1

I am fetching some system information e.g. processor name processor cores and many more and then showing them on NSTextFeild.

The issue is for the time the information is getting fetched, the application hangs.

So, I want to run the task asynchronously.

Note: I have just started with cocoa so please do describe your solution. pretty please.. thanks in advance.

Larme
  • 24,190
  • 6
  • 51
  • 81
Vikas Bansal
  • 10,662
  • 14
  • 58
  • 100

1 Answers1

1

Your UI hangs because you are doing work on the main thread. Hence this is a thread problem. You can then run that fetch for information on another thread, a background thread that doesn't interact with the UI, display something to the user that the data is currently getting retrieved and then, when the data is ready, display it in your NSTextField.

Read more

Community
  • 1
  • 1
StefanS
  • 1,089
  • 1
  • 11
  • 38