Note that there are some explanatory texts on larger screens.

plurals
  1. POiPhone MultiThreading
    primarykey
    data
    text
    <p>iPhone Development:</p> <p>I want to have an infinite loop constantly checking an NSMutableArray and if [size > 0] pull the first object, do something with it, remove it, wait .25 seconds, then continue checking.</p> <p>I want my GUI buttons to add this list. Is there a way to do this? Is there a way to do this by having the loop in the main thread?</p> <p><strong>UPDATE</strong> I guess i didn't ask the question properly. I'm using the AsyncSocket class to send telnet commands. I need to send them fast because their used to control a RC car, however the RC receiver is a tad slow. So i want to slow downs the rate in which my iPhone sends out the commands. Right now i have button events sending out the commands but i want to instead have the events add the command to a list/queue/array. In parralel to the button clicks I want a process to check the queue every .25 seconds and send out the commands in the queue.</p> <p><strong>MY PROBLEM:</strong></p> <p>the AsyncSocket isn't thread safe so I cannot have another thread sending commands. The documentation reads </p> <blockquote> <p>If you find yourself on a thread which is different from the thread on which AsyncSocket is running, and you need to invoke a method on AsyncSocket, then you must use a method like performSelector:onThread: to ensure the method is invoked on AsyncSocket's thread (and thereby maintaining thread-safety)."</p> </blockquote> <p>I dont know what this means...</p> <ol> <li>What does this quote above mean?</li> <li>Is multithreading required for what i want to do?</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload