Category Tech

Determining Delegate Object Method Call Order in Objective-C with NSProxy

This is a guest post + code, wrote together with Joe D’Andrea from LiquidJoe LLC! Many developers new to the iOS platform have trouble understanding the delegate architecture, in the sense that many other OO toolkits use properties to configure the characteristics of UI elements, instead of having a separate object doing the job. When [...]

A Proposed Architecture for Network-Bound iOS Apps

One of my most popular answers in StackOverflow is the one I gave to the following question: “What is the best architecture for an iOS application that makes many network requests?” The problem is the following: let’s consider a relatively complex application, which has to connect to, and retrieve and send data from different remote [...]

Useful 3rd Party Extensions to CoreTextWrapper

Our CoreTextWrapper project in Github is certainly popular! Many developers have told us that they find it easier to approach Core Text using it, providing an easy learning path, showing the key concepts with an easy-to-use example. Some developers have gone the extra mile, though: we have kindly received two enhancements for the project! Jared [...]

Smart Pointers in Objective-C++

One of the coolest features of C++ are templates, of which I’ve been drooling in the past. One of the most useful things that templates have brought to C++ are smart pointers, which simplify memory management tremendously; they combine the capacity of C++ to instantiate objects in the stack, the flexibility of heap allocation, and [...]

How knowing C and C++ can help you write better iPhone apps, part 1

While learning how to write iOS applications, you will often encounter the phrase “learn C first”. Writers of Cocoa applications apparently benefit from knowing about C (sometimes even C++), but it is not very clear to many new developers how this actually works. The obvious question being “why should I learn C if actually I [...]

Integrating iOS Applications with Backend REST Services

A couple of hours ago I finished my presentation at JAOO, a discussion of what I’ve learnt about integrating REST services in iOS apps while creating the iPhoneWebServicesClient project at Github. This project showcases different transport formats and libraries to consume web services from an iPhone application. It features a server application written in PHP, [...]

Migrating iPhone 3.x apps to iPad and iOS 4.0

Right now, creating Universal Applications for the iPod touch, the iPhone and the iPad is not really a straightforward task. The current panorama of iOS-compatible software and hardware platforms is getting more and more complex, and this blog post is a small guide (by no means exhaustive) of tips and tricks that have helped me [...]

Core Text Objective-C Wrapper

One of the most promising and mysterious new frameworks introduced in iOS 3.2 is Core Text. Apple defines Core Text as a “text drawing engine”, which allows Mac (and now iPad) apps to render rich text on any graphics context. Strings drawn with Core Text feature lots of custom settings such as detailed font information, [...]

Objective-C Categories as Stylesheets

It is very important that iPhone and iPad applications use visual styles in a coherent way. This helps users learn how to use your application faster, it helps them scan your UI for important information as quickly as possible, and it also can convey a strong marketing message; companies who want iPhone or iPad applications [...]

initWithContentsOfURL: Methods Considered Harmful

As I promised on Twitter, here’s a small discussion about the problems brought by the “initWithContentsOfURL:” family of methods. A quick search in the Xcode documentation browser brings in an interesting list of classes including this initializer (with or without additional parameters): NSArray NSManagedObjectModel NSData NSDictionary NSXMLParser NSMappingModel NSString AVAudioPlayer Don’t get me wrong, the [...]