Well… it’s done!
And you can see it in action!
During the following weeks, here’s what I’d like to do with this:
- Migrate JSON-based storage to SQLite.
- Use Core Location to determine the user’s actual location.
- Build a web interface to manage data, then expose it through a webservice. The app should check if it has Internet access and sync its local database if it does.
- UI love.
In the end, I’ll probably post it on the AppStore.
A conclusion/review to come in a future post.
Good night and thank you for watching!
After almost 11 hours
After being completely stuck a few hours ago, I’m now well on my way to finish a WORKING app, thanks to @Alin’s suggestion to use PhoneGap.
PhoneGap is a breath of fresh air and brings proper JavaScript coding into iPhone dev. PhoneGap is 100% an iPhone app which runs a web browser inside it and you build inside that. It works flawlessly and it even integrates with all the phone’s features.
I’ve also discovered Dashcode, an IDE/editor for developing Mac widgets and iPhone-ready apps. It generates standard html, css, js + images which I can copy over in Xcode, inside the PhoneGap project, and bam, proper iPhone app!
So, basically, I’ve dropped Objective-C and never want to look at it again
. And I’m still developing for the iPhone.
Yay I say!
8 hours later
Road block, road block!
I’ve been completely stuck for the past 2 hours. Nothing seems to work.
Because I haven’t seen Objective C code before, I thought the best way to learn is to look at some sample apps. I managed to change some stuff to kind of work as I want it to: show 5 things for a default, hardcoded location. This was working at 12pm and, since then, I’ve been wrestling with search and UIPickerView.
I may need to go back to the basic docs and clarify once and for all how to change views and how to transport data from one view to another.
Meanwhile, I did enjoy some gomboti (delicious desert, highly appreciated in Romania) and a cold, refreshing Beck’s.
I’m a bit down right now, I guess I need to blog less and work more
.
6 hours later
The last 2 hours have been pretty painful, trying to make sense out of the search box. No easy way to do search, it seems.
I’ve also looked into using UIPickerView instead, but that’s not trivial either.
It seems it’s time for me to dive completely into the code!
While searching for some decent tutorials, I came across this site and read some of the tutorials.
Good stuff! Other tutorial sites I found are this and this, but I didn’t spend much time on them, yet.
One of the nicest things I discovered in the past 2 hours was how to do “session storage”. Pretty neat, ain’t it?
I’ve just had lunch (spaghetti quattro formaggi with tomatoes) with my beautiful wife and I’m now having a strong espresso, on the couch. Time to get back to Xcode!
After 4 hours
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.
We already have some UI elements, because we’re building this on TopSongs:

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:

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:

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.

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
.
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:
Diving into Core Data now, I’ve decided to go with SQLite.
After 2 hours
Wow, it’s already been 2+ hours!
I started with browsing the iPhone Cookbook and implemented “hello world”. Didn’t quite work, I’m afraid, but I did get a general overview of the architecture.
Then I wanted to see some sample code, went to the iPhone Reference Library and downloaded UICatalog. UICatalog is great because it has all the standard iPhone UI elements in it. Good source
.
Core Data
My next objective was to research data storage on the iPhone. So I’m now reading an introduction and will continue with the programming guide.
In the meanwhile, I’ve also downloaded a couple more demo apps:
- TopSongs is a listing app that retrieves data either from a local XML (for demo purposes) or an online RSS feed (implemented, not active by default). I’m planning to use this as the basic framework for 5Things.
- TaggedLocations allows you to add data (events), it geocodes your location (why?) and invites you to add tags for each location. It’s a pretty good example of associating data structures on the iPhone.
Application UI
Using some components from UICatalog and TopSongs, I’ve spent a few minutes in Fireworks and created the UI for 5Things.
The main page shows a listing of 5 things in your current location by default. You can change the location by typing the new one in the search box. Maybe I’ll replace the search box with a list. What do you think?
There’s also a second-level screen with details about a thing. I didn’t spend much time on this because I won’t implement it today. No time
.
Daymap… a sort of roadmap
By 12pm, get the UI working with hardcoded data.
By 2pm, good on my way on integrating Core Data. For today, the app will read data from a local XML.
By 4pm, changing location should work.
By 6pm, screencast of the app running in iPhone Simulator.
By 8pm, buffer-time to finish everything.
By 10pm, at the cinema to watch Inglourious Basterds
.
So what are *you* doing today? :p
3… 2… 1… GO!
Today I’m going to learn how to create an iPhone app and make a simple travel app.
I have The iPhone Developer’s Cookbook by my side, both in print and pdf, and I hope it’ll get me through the day!
I’m thinking of posting updates every 1-2 hours. Yes, that’s how we’ll roll.
Here we goooooo!
Decision made: simple travel app
Let’s say you travel to Venice and plan to spend 3 days there, but you didn’t have enough time to do some proper research before you left: where to go, what to do, what to see. You’re a 100% spontaneous traveller.
But then you get there and, as you start walking through the city’s super-narrow streets, you tell yourself:
“I wish I knew what are the top 5 things to do in Venice!”
5things
5things (the new iPhone app I’m going to build) is a very simple mobile app that determines your location (you’ll be able to change it if it didn’t pinpoint you correctly) and suggests 5 things to do there.
That’s it and I’ll be the first to use it extensively!
Second idea: task list or shopping list with web component
This idea came from Andrei and he suggested an iPhone task list app that syncs seamlessly with a web app. Then Mihai suggested that tasks should be created by just sending a text email to a certain address.
I quite like the idea, although I don’t think I’d use the app myself. I’m more of a stickies-type person
.
What I *would use*, though, is a shopping list app that syncs with a web app. I now use ShopShop and it does its job fine. Still, I wouldn’t mind to see some stats about the items I buy the most, how much money I spent on different items and, why not, suggest stores that are closest to my current location.
Now I actually think I’m onto something, so I’ll give it some thought and decide wether to do this or find something else.
What shopping list apps do you use on your iPhone?
First idea: photo upload with a social twist
Charles Wiles shared this idea with me a couple of months ago.
It envisions an iPhone app that allows people who attend the same event (e.g. party, conference) to take photos and upload them somewhere online, using the same code.
By using the same code, all photos go into a single photo gallery, which eases the post-event pain of gathering and organizing them.
Facebook integration would be nice, but I haven’t yet found a way for multiple users to upload photos to the same album via the API/FBConnect.
What do you think? Is it worth it? Is it doable in 1 day?




