Creating a map-based iPhone app
July 18, 2009 at 11:52 am Filed in:code No Comments
The day word went out that OS 3.0 would finally include access to the google MapKit was the tipping point that finally got me to shell out the $99 to join the iPhone developer program. Unfortunately, at the time, documentation was sparse, and although the back end was in place, I couldn’t figure out how to display my annotations.
So I put my map-based projects on hold… until yesterday, that is, when I came across this easy-to-understand 3-part tutorial with sample code that very clearly shows how all the pieces are put together. A simple “Dude, where’s my car” app shows how to gets your current location, then allows you to place a marker at your current location.
Now, the original developers intent was simply to provide an example of how to use MapKit, so I’m not chiding them for lack of foresight in any way… but in its current state, it’s a bit too simplistic to be really useful as a parking app. But it could easily be tinkered with to provide additional functionality to make it useful:
- allow you to add markers at a location you define (in case you forgot to set where you parked when you were there)
- allow you to set a timer to let you know when your meter is about to run out (or in SF, when the two-hour period of time for people without permits has expired)
- store location info when you exit the app (’cause as is, you lose it when you answer a phone call, etc.)
- etc., etc.
Regardless, for whatever app you need a map, this project is a great start for learning how to get started with MapKit.
Working with Sample Code: Rename your project in Xcode 3.x
July 18, 2009 at 11:51 am Filed in:code No Comments
When I’m learning how to code in a new language, I like to start off some sample code that I know works, then mutilate it until it bears no resemblance to what the original developer came up with… but making sure that it still works at each step along the way.
But my adventures with Cocoa/Obj-C present a new challenge: no stand-alone php or perl files that can easily be shuffled and renamed… when you work with a language that requires the software be compiled, there’s a much deeper structure that needs to be modified in order to assign a new identity to the project.
Sadly, Xcode doesn’t have an option that allows you to create a new project from an existing project with a new name (note to Apple: this would be a great feature to include in 3.2, *wink wink nudge nudge*).
But in the meantime, when you have some sample code you want to play around with, but still hang on to the original and not muck up your hard drive with copies of copies of duplicates of copies… try this:
Continue Reading