Objective-C

Objective-C Snippet Tutorial - The UIAlertView


Posted in:

Displaying a message box in an iPhone application is something I have to look up almost every time. I decided it was time to create a tutorial on the subject - then maybe I'd actually remember the syntax. This tutorial will be short, but should cover pretty much everything you'd need to know in order to show alerts in an iPhone application.

Read More Icon Read More

Saving Settings using NSUserDefaults Class


Posted in:

Saving simple configuration options can be a chore unless you've found the right object. Today we're going to cover the NSUserDefaults object, which makes saving settings quick and easy. The app we're going to build as an example is a basic segmented control that will remember which button you've selected between launches.

Read More Icon Read More

How to Create and Populate a UITableView


Posted in:

It seems like every time I create an iOS application I use the UITableView. It's a very common control found in a lot of applications, however it's also one of the most difficult controls to use. Every time I use one I have to go out and find examples so I can remember what I'm supposed to do. Because of that, I decided to create a basic tutorial that wraps up the most common usage patterns for the UITableView.

Read More Icon Read More

Running a Method After A Delay on iPhone or Mac


Posted in:

In nearly every programming language there is a way to delay a method call. Objective-C is no different. They have built in a few simple methods to achieve this. We are going take a look at one of these methods today, all which reside in NSObject. This means any class you create will have the ability to call these methods. The method we are going to take a gander at is - (void)performSelector:(SEL)aSelector withObject:(id)anArgument afterDelay:(NSTimeInterval)delay, got the love the Objective-C method names.

Read More Icon Read More

Loading Images Asynchronously on iPhone using NSInvocationOperation


Posted in:

The iPhone SDK often makes doing things very easy, as long as you know where to look. Loading an Image into an UIImageView is one of these things. The problem I ran into, however, was that loading the image took too much time when performing the operation synchronously. To my surprise it wasn't much harder to load the image on a background thread. This was easily accomplished using NSOperation, specifically the prebuilt subclass NSInvocationOperation.

Read More Icon Read More

Using Shark to Performance Tune Your iPhone App


Posted in:

Here was the problem: we were working on an OpenGL iPhone game and for some reason the frame rates were unusually low - especially for what little action was happening on the screen at the time. My first plan of attack was to begin commenting out chunks of the system in an attempt to see what module was causing the problem. I removed the physics, the logic updates, and some of the things being rendered. Nothing I did, however, seemed to create a noticeable improvement in performance.

Read More Icon Read More

Finding Memory Leaks in iPhone Code


Posted in:

The video tutorial below shows how to use the performance tools that come with the Apple development kit to find memory leaks in Cocoa and Cocoa Touch code.

Read More Icon Read More

iPhone Tutorial - Searching the Web with the Bing SDK


Posted in:

Microsoft recently announced a new SDK for Cocoa and Cocoa touch applications that would easily allow developers to perform various searches using their new Bing "decision" engine. As a person actively working on iPhone applications, this is something I had to try out. This tutorial will introduce you to the Bing SDK and how to use it to build a simple web search application.

Read More Icon Read More

Building an Earthquake Monitor for iPhone using MapKit


Posted in:

The iPhone has plenty of neat features to use, one of the more recent features is using the built in Google Maps support. The specific SDK library we are looking at is MapKit.

Read More Icon Read More

Using SQLite on the iPhone


Posted in:

Most of the time, your iPhone application data storage needs will be taken care of by simple object serialization and flat file storage. However, there comes a point when that type of storage just won't work anymore - when you start storing thousands or tens of thousands of objects. Apple recognized that fact, and so gave app developers the ability to use SQLite inside their applications.

Read More Icon Read More