Hey guys, here's my issue. Working with the iPort... one of the commands to send through the serial port is getplaystatus and 4 bytes are returned to describe the length of the song in milliseconds. An example is a song as 4:39 to it... the length returned from is an array

byte[] b = {0x00, 0x04, 0x67, 0x83};

So 4:39 in milliseconds is 279000.

Somehow those bytes need to equal 279000... and I've run out of ideas. Any help would be most appreciated. Thanks!

~Marty


Question: When do I need to worry about thread-safety in an iOS application?
Answer: The concurrency programming guide is good. Here are some super important things to keep in mind.

– You should only update UI from the main thread. This can get you in subtle ways...

– NSNotifications will be received in the thread from which they are fired. So if you launch a thread and subscribe to a NSNotification to trigger a UI action, you should check what thread you're on when you get it. If it's not on the main thread use NSObject's performSelectorOnMainThread: withObject:waitUntilDone: to get it on the main thread.

– If you're doing some drawing into a non-ui context, I believe core graphics is now thread safe. (I believe CATiledLayer does some clever things because of this)

– Generally for view controllers, the only event loop you should think about is the one on the main thread. Think twice before making your own event loop on another thread.