1 day – 1 app

Building a ready-to-ship app in one day and being verbose about it.

After 4 hours

leave a comment »

Yes, the documentation on Apple’s site is rubbish.

How to add a search control to your iPhone app

Not as easy as it sounds, that’s for sure! IB has a nice library with all the components, so we open that from the Tools menu.

ib_lib

We already have some UI elements, because we’re building this on TopSongs:
ui_without_search

Dragging items from the library and dropping them on the UI doesn’t work. Nor on the UI elements files listed default as large icons:
ib_default_view

At this time, feel free to start reading through numerous tutorials. Click on everything. Then take a break and step back.

The secret is to change view mode to hierarchy view:
ib_hierarchy_view

Then you just drag and drop the item you want from the library on the parent element (View), while in hierarchy view. The element instantly appears in the interface and you can position it visually.
ui_with_search

How to concatenate strings in Objective C

It’s so fun to dive into the code without even knowing basic syntax like string concatenation! I feel like a sort of duct tape programmer :D .

Stack Overflow to the rescue and here’s what I’ve found:

[NSString stringWithFormat:@"%@ %@", @"Things in", @"London, UK"]
Result: Things in London, UK

[NSString stringWithFormat:@"%@ %@ %@", @"Top 5", @"things to do in", @"London, UK"]
Result: Top 5 things to do in London, UK

Lovely!

As promised, here’s what I now have in iPhone Simulator:

app_1205

Diving into Core Data now, I’ve decided to go with SQLite.

Advertisement

Written by Filip

September 25, 2009 at 12:07 pm

Posted in 2387

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.