It’s very common to use networking APIs on mobile devices because of their nature. On iOS I’m sure every programmer is familiar with NSURLConnection and the network activity indicator, which we are suppose to show when we do networking, and managing it is a pain in the ass. Let’s correct this.
Continue reading
Category Archives: Foundation
The truth about synchronous NSURLConnection
In this post, I’ll talk about NSURLConnection, the advantages and disadvantages about synchronous versus asynchronous connections. At the end I show a snippet of code on how to use an asynchronous NSURLConnection on a secondary thread into a concurrent NSOperation.
Continue reading
Collections and Integers, a matter of performance
In this post I talk about 2 different way to store integers values in a collection (Array, Set, Dictionary) and we will see that one of the 2 methods can give you far better performances, especially on an iPhone.
Continue reading
NSDateFormatter performance
In this post I talk about NSDateFormatter and how to use it correctly in your applications, especially iPhone ones, because a misuse of it can cause serious performances issues.
Continue reading
First step with NSRegularExpression
Regular expressions (regex) are often used because they are very practical, but there wasn’t native Cocoa API to simplify there usage, so programmers often used externals libraries like RegexKitLite.
Perhaps some of you read that applications that used this library would not longer be accepted on the App Store for some reasons, but yet I haven’t any problems with it, but who knows what Apple may decide.
So with the iOS 4 release, Apple introduce new class called NSRegularExpression which was exactly what programmers needed, I’ll show you in this post a very simple usage of it.
Continue reading
Improving NSLog()
When you debug an app, you often need to print informations on screen to check out if everything is ok etc… But when you are done and you are ready to release your application it’s a real pain in the ass to comment or remove all the call to these functions, plus they might be useful later.
Continue reading