Blog Archives

Avoiding the 30 second tcp timeout on iPhone OS

So you are writing the next great iPhone app and you pull some data from a server using TCP, but what happens in the unhappy scenario? TCP timeout takes about 30 seconds, if in the main loop, your app freezes,

Tagged with: , ,
Posted in Code

Playing a sound from Cocoa and setting the balance

The NSSound class is great for playing simple sounds, yet it lacks control over a more flexible way to play sounds. MacTrek plays sounds louder when they happen closer to the players position and balances them left or right when

Tagged with: ,
Posted in Code

Getting the version number from Info.plist in your code

If you are a lazy coder like me (or you don’t like to code version numbers all over the place) you should use the version number that Apple wants you to specify (in the Info.plist file) whenever you need to

Tagged with: , ,
Posted in Code

Feeding NSXMLParser a stream of xml

NSXMLParser is a great parser, but what if you are reading XML from, say a socket. You may not have the complete message right away, and there may be multiple root tags (or you can close and open a socket

Tagged with: , , ,
Posted in Code
Categories