Can you please tell me How can I get Control back from NSOperationQueue
Following is my real question which I asked earlier:
Hi friends , I made an app which plays the song on clicking on the image of artist.(see image attached). Each artist image is implemented on button and on clicking this button, a function is being called which first downloads and then plays the song. I passed this method(function) in a thread but problem is that every time when I click on the image of artist(button) new threads starts running and then multiple songs gets started playing concurrently. How can I use “NSOperation and NSOperationQueue” so that only one song will run at a time . Please help.

Thanks in advance
Now I am able to play song by adding them in queue but when songs starts playing i m not able to do anything on my Screen until song is finished or I scroll the table.
Have the main thread only queue one message. Have the thread performing the operation (playing a song) send a message back to the main thread indicating when it is done. Don’t queue any new operations in the main thread until the main thread receives this message back (statefulness).
Your main thread will get control back if the message is sent back to it with the perform selector on main thread method.