I’m including the netinet headers and doing some raw socket programming on the iPhone, and have found when making these calls, the UI won’t refresh until I’m finished- any response I get and write to the UI, isn’t written until the IBAction that made the call is complete. Using performSelector with a delay, I’ve been able to work around this, but I was wondering if there is a better way of handling this?
I’m including the netinet headers and doing some raw socket programming on the iPhone,
Share
In keeping with the general philosophy that it’s best to pick the highest level abstraction that is usable for you, I’ll suggest that perhaps CFSockets might also be a possibility.
CFSocket is sufficiently low-level that you can likely do whatever form of network communications you’re attempting, but it will help you by adding Run Loop integration. By using the run loop, you can avoid having to multi-thread your code. Using the run loop treats network events like any other source of events for your application.
See the CFNetwork Programming Guide for more information.