Appletell | Apple, Mac, iPhone, iPod | News, Rumors, Reviews, How-Tos

Subscribe to our content for free: (?)
Get our Daily Email

iPhone Developer Intervention Week 12: Threading

by Josh Holat on Jun 21, 2009 at 05:38 AM

XCode IconAfter the WWDC announcements last week, there is a lot to be excited about when it comes to developing for the iPhone. One thing that can potentially help applications run smoother and faster (especially when it comes to networking on the iPhone) is threading. Threading allows developers to run two or more tasks in concurrency. Apple makes this pretty easy in Objective-C and XCode.

If used correctly, threading can be a great way to quicken an application and make it more user friendly. If not used correctly, it is possible to both corrupt data and cause some pretty nasty crashes. Threading is especially useful on multicore processors, as each thread can be run on a separate core. That said, it can still be considered useful on the iPhone and iPod Touch.

For example, think of this scenario. When the user loads an app, it wants to load some photos from the Internet and display some sort of loading page at the same time. If the developer wants this page to remain useful while the images load, he or she can use threading. One thread can go out and fetch the data while the other can load the view as well as any other local files that might be needed. If this was all on one thread, it would have to go in order, so loading the images from the web would take longer than without threading.

You can find more information about threading through Apple’s documentation. Once you get the hang of it, it seems as if it can really help in applications. Either way, Apple makes it very simple for developers to implement, and I’m sure many developers have in their App Store applications.

See more iPhone Developer Intervention articles.

Subscribe to keep up with the latest Apple news and rumors! - Subscribe to our feed


Join the Discussion

Name: *

Email: *

Location (Links to Google Maps):

URL:

Enter Your Comment Below...

* Required fields

Remember my information?

Notify me of follow-up comments?

Submit the word you see below:


Special Features